| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Operators/Logical_AND_assignment | [Back] [Original] |
Get to know MDN better
let a = 1;
let b = 0;
a &&= 2;
console.log(a);
// : 2
b &&= 2;
console.log(b);
// : 0
x &&= y
const x = 0;
x &&= 2;
const x = {
get value() {
return 0;
},
set value(v) {
console.log("");
},
};
x.value &&= 2;
x y
const x = 0;
x &&= console.log("y ");
//
let x = 0;
let y = 1;
x &&= 0; // 0
x &&= 1; // 0
y &&= 1; // 1
y &&= 0; // 0
| ECMAScript 2027 LanguageSpecification # sec-assignment-operators |
| Web Proxy Viewer | New URL | Original Page |