【转载】js 中 获取 数据类型

时间:2019-02-14 17:54:11   收藏:0   阅读:137

function getType(n){

      return Object.prototype.toString.call(n);

}

 

null, undefined, number, boolean, string

object: Array, Date, Function

 

 

转载自:https://blog.csdn.net/jerny2017/article/details/80405872

原文:https://www.cnblogs.com/fixit/p/10375711.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!