JavaScript Tutorial For Beginners #15 – Logical Operators




In this JavaScript tutorial for beginners, I’ll show you the two logical operators we can use with our control flow statements (such as if statements and loops). The two operators are the AND operator ( && ) and the OR operator ( || ) .

The AND logical operator can be used when you need two or more conditions to be met, and the OR logical operator can be used when you only need ONE of two or more conditions to be met.

As always, any questions, fire ahead :).

SUBSCRIBE TO CHANNEL – https://www.youtube.com/channel/UCW5YeuERMmlnqo4oq8vwUpg?sub_confirmation=1

========== 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 – https://www.youtube.com/channel/UCW5YeuERMmlnqo4oq8vwUpg or http://thenetninja.co.uk

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

Twitter – @TheNetNinja – https://twitter.com/thenetninjauk

Original source


9 responses to “JavaScript Tutorial For Beginners #15 – Logical Operators”

  1. can you please explain the bitwise
    var first = 123;
    var second = false;
    var third = 456;
    var fourth = "abc";
    var fifth = true;
    alert(first & second); // 0
    alert(first & third); // 72
    alert(first & fourth); // 0
    alert(first & fifth); // 1

    alert(first && second); // false
    alert(first && third); // 456
    alert(first && fourth); // abc
    alert(first && fifth); // true

Leave a Reply