Web Dev Roadmap for Beginners (Free!): https://bit.ly/DaveGrayWebDevRoadmap
In this video we'll work through examples of Switch Statements in Javascript. All in less than 4 minutes!
▶ This video is part of the JavaScript Tutorials for Beginners Playlist found here: https://www.youtube.com/playlist?list=PL0Zuz27SZ-6Oi6xNtL_fwCrwpuqylMsgT
Quick Concepts outline:
Switch Statements in Javascript
(00:00) Intro
(0:13) Switch Statements are Conditionals
(0:17) Basic Syntax
(0:20) Value or Expression followed by Case evaluation
(0:28) Logical Order is important
(0:33) Use break keyword
(0:38) Default option
(0:50) Example #1
(1:20) Switch statements use strict equality matches
(1:32) Example #2: Evaluate numbers
(2:12) Example #3: Rock - Paper - Scissors Decision Tree
Further Reading:
MDN Web Docs - https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/conditionals
More Beginner JS Videos:
freeCodeCamp: https://youtu.be/PkZNo7MFNFg
Traversy Media: https://youtu.be/hdI2bqOjy3c
The Net Ninja: https://youtu.be/iWOYAxlnaww
Follow Me:
Twitter: https://twitter.com/yesdavidgray
Reddit: https://www.reddit.com/user/DaveOnEleven
Medium: https://medium.com/@davegray_86804
#Javascript #Switch #Statements