我正在尝试新的JavaScript可选链接语法,它似乎对没有返回值的方法有问题。const restaurant = { console.log(`I was here with ${i} and ${k}`);console.log(orderCheck ); // it returns undefined
现在的问题是,如果我将上面的case与Nullish合并运算符一起</e
我知道在JavaScript中你可以这样做:
var oneOrTheOther = someOtherVar || "these are not the droids you are looking然而,当我们使用逻辑AND运算符时,变量oneOrTheOther被赋予了什么呢?我正在学习JavaScript,我很好奇将赋值与and运算符一起使用时会发生什么。