美文网首页
基本类型的包装类型

基本类型的包装类型

作者: 颠倒的黑白 | 来源:发表于2017-06-21 17:11 被阅读0次

    没啥实际意义

    var str = 'hello vue';
    var strObj = new String(str);
    
    console.log([str,strObj]);
    console.log([typeof str ,typeof strObj])
    console.log([str instanceof String,strObj instanceof String])
    
    var n = new Number(10);
    console.log([typeof n,typeof ++n])
    

    相关文章

      网友评论

          本文标题:基本类型的包装类型

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