📅  最后修改于: 2022-03-11 15:01:20.111000             🧑  作者: Mango
// bool will be false if object is null, false, 0, etc.
// bool will be true if object is an array, object, non-zero number, etc.
// method 1
let bool = !!object;
// method 2
let bool = Boolean(object);