摘要:
例如,我们要访问 info 对象的 animal 的 reptile 的 tortoise。但是我们不确定 animal,reptile是否存在,因此我们需要这样写: const tortoise = info.animal && info.animal.reptile && info.animal 阅读全文
posted @ 2020-11-25 15:16
酸suan
阅读(149)
评论(0)
推荐(0)
摘要:
let x = (foo !== null && foo !== undefined) ? foo : bar(); 版本二: let x = foo ?? bar(); 阅读全文
posted @ 2020-11-25 14:51
酸suan
阅读(143)
评论(0)
推荐(0)
摘要:
//Number类型在超过9009199254740991后,计算结果即出现问题 const num1 = 90091992547409910; console.log(num1 + 1); //90091992547409900 //BigInt 计算结果争取 const num2 = 90091 阅读全文
posted @ 2020-11-25 14:22
酸suan
阅读(565)
评论(0)
推荐(0)
摘要:
阅读全文
阅读全文
posted @ 2020-11-25 14:11
酸suan
阅读(282)
评论(0)
推荐(0)

浙公网安备 33010602011771号