📜  逻辑赋值运算符 null 合并 - 无论代码示例

📅  最后修改于: 2022-03-11 14:57:57.298000             🧑  作者: Mango

代码示例1
const a = null;
const b = 3;
a ??= b;
console.log(a); // returns 3
// the above statement is equivalent to
if (a === null || a === undefined) {
  a = b;
}