- 3

Guys Please someone should explain switch statement more easy for me please

I don't understand the switch statement

6th Mar 2021, 1:47 PM
Kwabena Karikari Affum
Kwabena Karikari Affum - avatar
11 ответов
+ 1
Is getDay an inbuilt word in JS
6th Mar 2021, 2:04 PM
Kwabena Karikari Affum
Kwabena Karikari Affum - avatar
+ 1
Kwabena Karikari Affum I have explained to you as much as I can .
6th Mar 2021, 7:36 PM
Matias
Matias - avatar
0
Amogha what is that new Date().get day()
6th Mar 2021, 1:55 PM
Kwabena Karikari Affum
Kwabena Karikari Affum - avatar
0
Kwabena Karikari Affum Switch statement is just like if statement. A switch statement first evaluates its expression. It then looks for the first case clause whose expression evaluates to the same value as the result of the input expression (using the strict comparison, ===) and transfers control to that clause, executing the associated statements. (If multiple cases match the provided value, the first case that matches is selected, even if the cases are not equal to each other.) If no matching case clause is found, the program looks for the optional default clause, and if found, transfers control to that clause, executing the associated statements. If no default clause is found, the program continues execution at the statement following the end of switch. By convention, the default clause is the last clause, but it does not need to be so. The optional break statement associated with each case label ensures that the program breaks out of switch once the matched statement is executed and continues execution
6th Mar 2021, 2:03 PM
Matias
Matias - avatar
0
Amogha I get you the getDay is an inbuilt word for getting the current day from 0-6 which means 0 is Sunday
9th Mar 2021, 11:12 AM
Kwabena Karikari Affum
Kwabena Karikari Affum - avatar
- 1
So get day is inbuilt . Without getDay will the code work
6th Mar 2021, 2:00 PM
Kwabena Karikari Affum
Kwabena Karikari Affum - avatar
- 1
Matiyas this doesn't explain it to me
6th Mar 2021, 2:06 PM
Kwabena Karikari Affum
Kwabena Karikari Affum - avatar