| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Operators/Logical_NOT | [Back] [Original] |
Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
This feature is well established and works across many devices and browser versions. Its been available across browsers since 2015 ..
const a = 3;
const b = -2;
console.log(!(a > 0 || b > 0));
// Expected output: false
!expr;
false, true; true.
true, (truthy). false, (falsy).
, false:
null;NaN;0;"", '', ``);undefined. , ! , Boolean, , . ( ) , Boolean.
! ( ).
n1 = !true; // !t false
n2 = !false; // !f true
n3 = !""; // !f true
n4 = !"Cat"; // !t false
!!)n1 = !!true; // !!truthy true
n2 = !!{}; // !!truthy true: - ...
n3 = !!new Boolean(false); // ... Boolean- false .valueOf()!
n4 = !!false; // !!falsy false
n5 = !!""; // !!falsy false
n6 = !!Boolean(false); // !!falsy false
:
!!bCondition;
:
bCondition;
| Specification |
|---|
| ECMAScript 2027 LanguageSpecification # sec-logical-not-operator |
This page was last modified on 29 . 2026 . by MDN contributors.
Your blueprint for a better internet.
Portions of this content are 19982026 by individual mozilla.org contributors. Content available under a Creative Commons license.
| Web Proxy Viewer | New URL | Original Page |