multiple case switch javascript
//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"switch (varName)
{
case "afshin":
case "saeed":
case "larry":
alert('Hey');
break;
default:
alert('Default case');
}
Also in JavaScript:
- javascript Prevent Object MutationPassed
- get length of array
- input output ionic
- difference between foreach and map in js
- javascript setattribute onclick function with parameters
- angular input press enter
- Extension server error: Object not found: <top>, source: devtools://devtools/bundled/extensions/extensions.js (216) [9900:1226/171021.620
- bigint type js
- how to check is the key of a localstorage is emopty
- javascript add update query parameter to url
- how to add two number using jqueryu
- generate random number javascript
- how get height elemnt with that margin in js
- axios react
- math.floor js
- inverser l'ordre des item d'un array js
- how to run nextjs in another port
- passing a variable to the width style div angular
- detect a click outside an element javascript
- convert date to string javascript
- pull out only text from element javascript
- target data option select vue js
- javascript on url anchor change event
- deploy react js heroku