use cases javascript code example
Example 1: javascript switch statement multiple cases
//javascript multiple case switch statement
var color = "yellow";
var darkOrLight="";
switch(color) {
case "yellow":case "pink":case "orange":
darkOrLight = "Light";
break;
case "blue":case "purple":case "brown":
darkOrLight = "Dark";
break;
default:
darkOrLight = "Unknown";
}
//darkOrLight="Light"
Example 2: javascript statement
// STATEMENT: Code that performs actions (generally something that ends in ";"
// example:
const str = `String assigned to str`;
// EXPRESSION: Code that produces a value
// example(s):
3 + 4
1991
true && false && false