Logical operators thumbnail
Logical operators
javascript.info
A double NOT !! is sometimes used for converting a value to boolean type: Sometimes, people use this feature to execute commands only if the condition on the left part is falsy. In other words, AND returns the first falsy value or the last value if none were found. The precedence of NOT ! is the hig
11 Users
0 Comments
115 Highlights
2 Notes

Top Highlights

  • A double NOT !! is sometimes used for converting a value to boolean type:
  • Sometimes, people use this feature to execute commands only if the condition on the left part is falsy.
  • In other words, AND returns the first falsy value or the last value if none were found.
  • The precedence of NOT ! is the highest of all logical operators, so it always executes first, before && or ||
  • In other words, a chain of OR || returns the first truthy value or the last one if no truthy value is found.

Ready to highlight and find good content?

Glasp is a social web highlighter that people can highlight and organize quotes and thoughts from the web, and access other like-minded people’s learning.