使用!转换为Boolean。(在JS中,除了 0、""、null、undefined、NaN 和 false 是假值之外,其他的都是真值。)
let theTrue = !0; // true
let theFalse = ![]; // false
使用!转换为Boolean。(在JS中,除了 0、""、null、undefined、NaN 和 false 是假值之外,其他的都是真值。)
let theTrue = !0; // true
let theFalse = ![]; // false