摘要: var num = Number("10"); //类型转换var num2 = new Number("10"); //基本包装类型console.log(typeof num); //numberconsole.log(typeof num2); //object 阅读全文
posted @ 2018-11-22 15:37 L_G_Y 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 运算符 【 || && 】两边的表达式为对象时:非空即true、空则false : 阅读全文
posted @ 2018-11-22 15:30 L_G_Y 阅读(191) 评论(0) 推荐(0) 编辑
摘要: 1、改变字符串中的字符 var str = "hello"; str[1] = "W"; console.log(str);//结果是【hello】,说明字符串的值是不可变的。 2、引用字符串的变量地址变了(指向了新的字符串),字符串本身没有变。【此时,字符串是对象,str指向的是字符串的地址】 s 阅读全文
posted @ 2018-11-22 11:20 L_G_Y 阅读(2623) 评论(0) 推荐(0) 编辑