方式 说明 案例
    boolean()函数 其他类型转成布尔值 Boolean(‘true’);
    • 代表空、否定的值会被转换为false,如’‘、0、NaN、null、undefined
    • 其余值都会被转换为true