公告

👇 微信 👇

欢迎大家私信交流

Skip to content

将任意类型转为Boolean的方案

1.Boolean函数

js
Boolean('') // false
Boolean(1) // true

2.取反两次

js
!!'' // false