boolean(布尔类型)

boolean数据类型:true 和 false

把其他类型值转换为布尔类型

  只有0、NaN、''、null、undefined 五个值转换为布尔值是false,其余都转换为true(而且没有任何的特殊情况)

  Boolean([val])

  !/!!  // !:取反(先转为布尔值,再取反)

  条件判断

原文地址:https://www.cnblogs.com/cuishuangshuang/p/14635604.html