美文网首页
Object.prototype.toString.call 检

Object.prototype.toString.call 检

作者: royluck | 来源:发表于2019-04-03 11:53 被阅读0次
    console.log(Object.prototype.toString.call("jerry"));  //[object String]
    console.log(Object.prototype.toString.call(12));  //[object Number]
    console.log(Object.prototype.toString.call(true));  //[object Boolean]
    console.log(Object.prototype.toString.call(undefined));  //[object Undefined]
    console.log(Object.prototype.toString.call(null));  //[object Null]
    console.log(Object.prototype.toString.call({name: "jerry"}));  //[object Object]
    console.log(Object.prototype.toString.call(function(){}));  //[object Function]
    console.log(Object.prototype.toString.call([]));  //[object Array]
    console.log(Object.prototype.toString.call(new Date));  //[object Date]
    console.log(Object.prototype.toString.call(/\d/));  //[object RegExp]
    function Person(){};
    console.log(Object.prototype.toString.call(new Person));  //[object Object]
    

    相关文章

      网友评论

          本文标题:Object.prototype.toString.call 检

          本文链接:https://www.haomeiwen.com/subject/yrvabqtx.html