The following JS demo is what I learned in “Dark Horse Programmer: Web Front-end Development skills, JavaScript from zero to master”. It needs to be recorded in order to learn.
Write some basic JS demo, if there is a mistake, but also hope to correct, record some of their own learning after and exercises, very useful, thank you, now I have a headache dazzling, there is a wrong place also hope to point out, I correct, very grateful! (23:18, February 2, 2021) good night!
1. Use the switch statement to query the fruit case:
Operation effect 1:
Operation effect TWO:
2 use if else to determine whether the year is a leap year:
Operation effect 1:
Operation effect TWO:
3 use if else statement to identify the case of Internet cafe access right:
Operation effect 1:
Operation effect TWO:
4 use if else-if else judgment statement to achieve, grades classification cases:
Operation effect 1:
Operation effect TWO:
5 use? This ternary expression implements the number complement zero operation:
Operation effect 1:
Operation effect TWO: