摘要: var a = "123"; delete a; //false console.log(a); //123 b = "123"; delete b; //true; console.log(b)//Uncaught ReferenceError: b is not defined var c = 阅读全文
posted @ 2017-07-31 17:21 *﹏漸洐漸薳〆… 阅读(137) 评论(0) 推荐(0)
摘要: 原始值和引用值 在 ECMAScript 中,变量可以存在两种类型的值,即原始值和引用值。 原始值存储在栈(stack)中的简单数据段,也就是说,它们的值直接存储在变量访问的位置。引用值存储在堆(heap)中的对象,也就是说,存储在变量处的值是一个指针(point),指向存储对象的内存处。 对象转数 阅读全文
posted @ 2017-07-31 15:38 *﹏漸洐漸薳〆… 阅读(166) 评论(0) 推荐(0)
摘要: var str = "hello world"; str.len = 4; console.log(str.len); //undefined console.log(typeof str);//string 第二行代码创建一个临时字符串对象,并给其len属性赋值位4,随机销毁这个对象。 第三行通过 阅读全文
posted @ 2017-07-31 14:15 *﹏漸洐漸薳〆… 阅读(122) 评论(0) 推荐(0)