Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Logical Operators
- //AND and OR
- console.log(1 === 1 && 2 === 2); // returns true
- //the above says that if 1 = 1 AND 2 = 2, then return true
- //ALL statements seperated by AND (&&) must be true for the statement to be true as a whole
- console.log(1 === 1 || 2 < 1); // returns true
- //the above says that if 1 = 1 OR 2 < 1 return true. Only ONE statement seperated by OR (||)
- //needs to be true
- //to return true
- //Not True
- console.log(! 1 === 1);
- // The not (!) operator returns the opposite of whatever
- //the boolean would have been.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement