0

Don't know the answer of this question.

What will be alerted? var month = 04; switch (month){ case 1 : alert ("04/17"); break; case 2 : alert ("may 04"); break; case 3 ; alert ("april"); break; default: alert ("march"); }

19th Sep 2017, 5:42 PM
Sandor Beata
2 Réponses
+ 6
Keep in mind the 0 infront of the 4 means the number is taken in Octal (Base 8). It just so happens that 4 in Octal is equal to 4 in decimal form. (Also there's a semi-colon next to 'case 3' which would cause an error)
19th Sep 2017, 6:12 PM
Rrestoring faith
Rrestoring faith - avatar
+ 1
Thank you
19th Sep 2017, 5:50 PM
Sandor Beata