检查给定的参数是否为本机布尔元素。
使用typeof检查某个值是否被归类为布尔基元。
typeof
const isBoolean = val => typeof val === 'boolean'; // isBoolean(null) -> false // isBoolean(false) -> true
Copyright© 2013-2020
All Rights Reserved 京ICP备2023019179号-8