| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Operators/Logical_AND | [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 7.
AND (&&) ( ) true true
.
const a = 3;
const b = -2;
console.log(a > 0 && b > 0);
// Expected output: false
expr1 && expr2
true (truthy)
. false (falsy)
.
.
false;null;NaN;0;"" or '' or ``);undefined.AND .
result = "" && "foo"; // result ""( )
result = 2 && 0; // result 0
result = "foo" && 4; // result 4 .
AND (short-circuit, ) . ,
false AND .
.
.
(some falsy expression) && expr
(some falsy expression)
, expr . expr .
.
function A() {
console.log("called A");
return false;
}
function B() {
console.log("called B");
return true;
}
console.log(A() && B());
// A "called A" .
// && false ( A false ) false .
// AND B .
true || (false && false); // returns true
true && (false || false); // returns false
2 === 3 || (4 < 0 && 1 === 1); // returns false
&&( AND) .
a1 = true && true; // t && t returns true
a2 = true && false; // t && f returns false
a3 = false && true; // f && t returns false
a4 = false && 3 === 4; // f && f returns false
a5 = "Cat" && "Dog"; // t && t returns "Dog"
a6 = false && "Cat"; // f && t returns false
a7 = "Cat" && false; // t && f returns false
a8 = "" && false; // f && f returns ""
a9 = false && ""; // f && f returns false
bCondition1 && bCondition2;
.
!(!bCondition1 || !bCondition2);
bCondition1 || bCondition2;
.
!(!bCondition1 && !bCondition2);
.
bCondition1 || (bCondition2 && bCondition3);
.
bCondition1 || bCondition2 && bCondition3;
| Specification |
|---|
| ECMAScript 2027 LanguageSpecification # prod-LogicalANDExpression |
This page was last modified on 2026 7 15 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 |