[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Operators/Logical_NOT [Back]  [Original]

NOT (!) - JavaScript | MDN

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

NOT (!)

Baseline Widely available

This feature is well established and works across many devices and browser versions. Its been available across browsers since 2015 7.

NOT (!) ( , ) , . () . , true false , true .

In this article

const a = 3;
const b = -2;

console.log(!(a > 0 || b > 0));
// Expected output: false

js
!x

true false . , true .

true , . false , .

.

  • null;
  • NaN;
  • 0;
  • ("" or '' or ``);
  • undefined.

! , . ( ) NOT (!!) Boolean .

NOT

!( NOT) .

js
!true; // !t  false 
!false; // !f  true 
!""; // !f  true 
!"Cat"; // !t  false 

NOT (!!)

NOT 2 . " " " " ( ).

Boolean .

js
!!true; // !!truthy true .
!!{}; // !!truthy true .  object   .
!!new Boolean(false); // .valueOf() false   !
!!false; // !!falsy false .
!!""; // !!falsy false .
!!Boolean(false); // !!falsy false .

NOT

js
!!bCondition

.

js
bCondition

Specification
ECMAScript 2027 LanguageSpecification
# sec-logical-not-operator


Web Proxy Viewer  |  New URL  |  Original Page