《2018年9月22日》【连续354天】
标题:包装类;
内容:
// 构造函数内部原理
// 1.在函数体最前面隐式的加上this = {}
// 2.执行 this.xxx = xxx;
// 3.隐式的返回this
//包装类
var num = 4;
num.len = 3; //y原始值不可能有属性
// new Number(4).len = 3;
// delete
//new Number(4).len
console.log(num.len);
//undefined
var str ="abcd";
str.length = 2;
//new String("abcd").length = 2;
// delete
console.log(str.length);
//new String("abcd").length
//4