Skip to content

PRO TIP Block youtube.com at the DNS level — Pi-hole, NextDNS or your hosts file — but allow youtube-nocookie.com and i.ytimg.com. These tutorials keep playing; the rabbit hole does not.

Learning without distractions

If Statements in Javascript | Tutorial for Beginners

14.8K views on YouTube

Web Dev Roadmap for Beginners (Free!): https://bit.ly/DaveGrayWebDevRoadmap

In this video we’ll work through several examples of If Statements in Javascript. All in less than 7 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:
If Statements in Javascript
(00:00) Intro
(0:11) If Statements are Conditionals
(0:19) Basic Syntax
(0:35) Else clauses
(0:45) Example If Statement #1
(2:15) Else If clauses
(2:30) Consider the Logical Order
(2:55) Checking for Two Conditions at Once
(3:25) Example If Statement #2
(3:55) “Waterfall” Logical Order
(4:45) Nested If Statements
(5:10) Decision Tree Thinking: Rock – Paper – Scissors

📚 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 #If #Statements