2019年3月26日

摘要: 数组方法 concat 连接2个或更多数组,并返回结果 every 对数组中的每一项运行给定函数,如果该函数对每一项都返回true,则返回true filter 对数组中的每一项运行给定函数,返回该函数会返回true的项组成的数组 forEach 对数组中的每一项运行给定函数。这个方法没有返回值 j 阅读全文
posted @ 2019-03-26 13:42 完美前端 阅读(197) 评论(0) 推荐(0)
摘要: var array1 = [1, 2, 3];console.log(array1.includes(2)); // trueconsole.log(array1.includes(2, 5)); // false array1.includes(value, index); // value 要搜 阅读全文
posted @ 2019-03-26 11:37 完美前端 阅读(421) 评论(0) 推荐(0)
摘要: ES5 写法 // 使用构造函数和原型创建Book类 function Book(title, pages, isbn) { this.title = title; this.pages = pages; this.isbn = isbn; } // 在原型上添加printTitle方法 Book. 阅读全文
posted @ 2019-03-26 11:03 完美前端 阅读(135) 评论(0) 推荐(0)

导航