![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
每日js
love-study-lele
和我一起学前端吧
展开
-
判断各种数据类型
/** * @function type * @param {any} obj - 被判断的对象 * @return {string} 返回类型:array/date/string/object/undefined/function/boolean/null/regexp/math 等 */ var getType = function getType(obj) { return Object.prototype.toString.call(obj).slice(8, .原创 2021-01-25 15:11:12 · 295 阅读 · 1 评论 -
js 数据类型
基本类型 number string boolean null undefined symbol bigint 对象类型 标准普通对象:object 标准特殊对象:Array/RegExp/Date 非标准特殊对象:Number/String/Boolean 可调用对象: funtion NaN === NaN ===>false 判断是否为有效数字使用isNaN(),默认隐式转换为数字类型Number() Object.is(10,10) ===> t...原创 2021-01-22 17:28:26 · 190 阅读 · 0 评论