![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
JavaScript
步步咏凉天
这个作者很懒,什么都没留下…
展开
-
JavaSript的Array对象属性和方法(附示例代码)
文章目录Array 对象Array 对象属性constructor例子 1例子 2length实例Array 对象方法concat():用于连接两个或多个数组。例子 1例子 2例子 3join() :把数组中的所有元素放入一个字符串例子 1例子 2pop() :用于删除并返回数组的最后一个元素。实例push() :可向数组的末尾添加一个或多个元素,并返回新的长度。实例reverse() :用于颠倒数组中元素的顺序。实例shift() :用于把数组的第一个元素从其中删除,并返回第一个元素的值。实例unshif转载 2020-09-03 15:37:50 · 213 阅读 · 0 评论 -
JavaScript常见类型转换
值 转换为字符串 转换为数字 转换为布尔值 转换为对象 undefined “undefined” NaN false throws TypeError null “null” 0 false throws TypeError true “true” 1 new Boolean(true) false “false” 0 new Boolean(false) “”(空字符串) 0 false new String("") “1.2”(非空...原创 2020-09-01 14:46:16 · 114 阅读 · 0 评论 -
JavaScript中的null和undefined
null和undefined都表示值的空缺 null 是JavaScript语言的关键字,undefined 不是JavaScript语言的关键字 null 可以表示数字、字符串和对象是“无值”的 undefined 表明变量没有初始化 typeof(null);//"object" typeof(undefined); // "undefined" null == undefined; //true null === undefined; // false 参考: 《JavaScript权威指南.原创 2020-09-01 10:18:17 · 175 阅读 · 0 评论