判断所有数据类型的方法

function getType(type){
        if(typeof type !== 'object'){
            return typeof type
        }
        console.lo
        return Object.prototype.toString.call(type).replace(/^\[object (\S+)\]$/,"$1")
    }

 

posted @ 2024-02-21 12:53  nlovestudy  阅读(2)  评论(0编辑  收藏  举报