摘要: JS实现继承 JavaScript 定义一个父类: // 定义一个动物类 function Animal (name) { // 属性 this.name = name || ‘Animal’; // 实例方法 this.sleep = function(){ console.log(this.na 阅读全文
posted @ 2020-03-31 12:07 85455 阅读(125) 评论(0) 推荐(0)
摘要: 语法 arr.includes(searchElement) arr.includes(searchElement, fromIndex) 实例 检测数组 site 是否包含 runoob : let site = ['runoob', 'google', 'taobao']; site.inclu 阅读全文
posted @ 2020-03-29 18:45 85455 阅读(294) 评论(0) 推荐(0)