摘要: // 可选链 ?. 的为空判断 let a, b; /* 使用前 */ if (!!a) { b.name = 123; } else { b = undefined; } // 使用后 b = a?.name; console.log(b); 和运算符&&类似 console.log(1 && 2 阅读全文
posted @ 2022-04-20 09:45 Model-Zachary 阅读(33) 评论(0) 推荐(0) 编辑