Hi all. In this JavaScript tutorial for beginners, we’re going to take our first look at control flow – if statements. If statements are alive everywhere you look in the world. If you perform an action, there will be a corresponding reaction or result. This concept is used in programming too.

If statements can be used to check a variety of things in JavaScript, such as whether a certain element has a particular class associated with it, or to check if an element is showing on a web page. They’re an extremely important aspect of JS, and will be VERY helpful in your future coding!

As usual, any questions just ask away :).


========== JavaScript for Beginners Playlist ==========

========== CSS for Beginners Playlist ==========

========== HTML for Beginners Playlist ==========

========== The Net Ninja ============

For more front-end development tutorials & to black-belt your coding skills, head over to – or

========== Social Links ==========

Twitter – @TheNetNinja –


  1. One comment: Please speak a little slower, thank you!
    One question: If an expression evaluates to false and there is no else statement…nothing happens…..but is an expression evaluates to false and there is an if..else statement then the else statement runs. Well at least that was the case in the example you provided but it could be that "false" is the case we're looking false and in that instance "if" would run first. Did i confuse you? Thanx, Ingrid


Please enter your comment!
Please enter your name here