JavaScript Logical Operators
JavaScript Logical Operators
The logical operators
returns a boolean value by determining the logic between the values.
And Operator
And Operator returns true only if both the condition in the LHS and RHS are true. Otherwise it returns false.
Example
JavaScript Logical Operators
The following are the list of logical operators available in JavaScript.
Operator | Explanation | Operation | Result |
---|---|---|---|
&& | and | (5 < 10 && 3 < 10) | true |
|| | or | (5 < 10 || 3 > 10) | true |
! | not | !(5 > 3) | false |
OR Operator
OR Operator returns true if any of the conditions in the LHS or RHS is true. Otherwise it returns false.
Example
Not Operator
Not Operator reverses the logic of a result.
Example
Reminder
Hi Developers, we almost covered 97% of JavaScript Tutorials with examples for quick and easy learning.
We are working to cover every Single Concept in JavaScript.
Please do google search for:
Join Our Channel
Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.
This channel is primarily useful for Full Stack Web Developer.