| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Operators/Logical_OR_assignment | [Back] [Original] |
Get to know MDN better
const a = { duration: 50, title: "" };
a.duration ||= 10;
console.log(a.duration);
// : 50
a.title ||= "title is empty.";
console.log(a.title);
// : "title is empty."
x ||= y
const x = 1;
x ||= 2;
const x = {
get value() {
return 1;
},
set value(v) {
console.log("");
},
};
x.value ||= 2;
const x = 1;
x ||= console.log("y ");
//
"lyrics"
document.getElementById("lyrics").textContent ||= "No lyrics.";
: API ||= ( null undefined ) ??=
| ECMAScript 2027 LanguageSpecification # sec-assignment-operators |
| Web Proxy Viewer | New URL | Original Page |