defautl keyword is used in two situations
1)switch statement.
2)export statement.
1) example of switch statement
switch (expr) {
case "Oranges":
console.log("Oranges are my 1st choice.");
break;
case "Apples":
console.log("Apples are second choice.");
break;
default:
console.log("Sorry,Evon " + expr + ".");
}
2) example of export statement
let cube = function cube(x) {
return x * x * x;
}
export default cube;
0 Comment(s)