📜  ?? javascript代码示例

📅  最后修改于: 2022-03-11 15:02:54.387000             🧑  作者: Mango

代码示例6
?? (The Nullish Coalescing Operator)

const foo = null ?? 'default string';
console.log(foo);
// expected output: "default string"

const baz = 0 ?? 42;
console.log(baz);
// expected output: 0