js lcase code example
Example 1: js switch case
switch(expression) {
case x:
// code block
break;
case y:
// code block
break;
default:
// code block
}
Example 2: js to lowercase
var str = "Hello World!";
var res = str.toLowerCase();
Example 3: tolowercase
const sentence = 'The quick brown fox jumps over the lazy dog.';
console.log(sentence.toLowerCase());
// expected output: "the quick brown fox jumps over the lazy dog."
Example 4: how to use switch case in javascript
switch (expression) {
case value1:
//Statements executed when the
//result of expression matches value1
[break;]
case value2:
//Statements executed when the
//result of expression matches value2
[break;]
...
case valueN:
//Statements executed when the
//result of expression matches valueN
[break;]
[default:
//Statements executed when none of
//the values match the value of the expression
[break;]]
}