将truthy/falsy转换为布尔值 By @hakhag on Jan 30, 2016原文:将truthy/falsy转换为布尔值 - 每天一个JavaScript小知识@Js中文网 · 码农进阶题库原文地址:https://www.javascriptc.com/interview-tips/zh_cn/javascript/converting-truthy-falsy-values-to-boolean/你可以使用!!操作符将truthy或falsy值转换为布尔值。!!"" // false !!0 // false !!null // false !!undefined // false !!NaN // false !!"hello" // true !!1 // true !!{} // true !![] // true 扩展阅读:【JS】falsy与truthy - 思否js 中的Truthy 和Falsy(真值与假值)JavaScript数据类型转换原文标题:将truthy/falsy转换为布尔值 - 码农题库@Js中文网 · 前端进阶资源教程原文地址:https://www.javascriptc.com/interview-tips/zh_cn/javascript/converting-truthy-falsy-values-to-boolean/