- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Is the !! (not not) operator in JavaScript equivalent to reverse process of not operator?
Yes, the not not operator is the reverse process of not operator. If any value is true then single ! (not) will return false and !! will return opposite value (true).
The not operator −
var flag=true; console.log(!flag);
The not not operator −
var flag=true; console.log(!!flag);
Example
Following is the code −
var flag=true; console.log("The result of single !=") console.log(!flag); console.log("The result of single !!=") console.log(!!flag)
To run the above program, you need to use the following command −
node fileName.js.
Here, my file name is demo247.js
Output
This will produce the following output on console −
PS C:\Users\Amit\javascript-code> node demo247.js The result of single != false The result of single !!= True
Advertisements