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

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

posted @ 2019-02-14 17:17  fixit  阅读(134)  评论(0)    收藏  举报