摘要: Set: 一种新的数据结构,set中的值是唯一的,是数据结构中的集合 声明方式: const set = new Set([1,2,2,3,4]) console.log(set) // {1, 2, 3, 4} 常用方法: set.add(5) // 添加元素 set.add(6).add(7) 阅读全文
posted @ 2020-07-30 14:13 Momentt 阅读(115) 评论(0) 推荐(0)
摘要: Symbol: 一种新的原始数据类型,Symbol不是一个对象,不可以new Symbol的声明方式: const s1 = Symbol('s1') const s2 = Symbol('s1') console.log(typeof s1) console.log(s1 s2) // false 阅读全文
posted @ 2020-07-30 12:33 Momentt 阅读(205) 评论(0) 推荐(0)
摘要: ES5中: function People(name,age,number){ this.name = name this.age = age //实例属性 People.number = number //静态属性 } //实例方法 People.prototype.showName = func 阅读全文
posted @ 2020-07-29 14:59 Momentt 阅读(119) 评论(0) 推荐(0)
摘要: ES5: for:可以使用break和continue forEach: 没有返回值,在forEach中不可以使用break和continue,即在遍历过程中不可以退出 map:返回一个新数组,新数组的元素是函数的执行结果 filter:返回一个新数组,数组中的值是符合function条件的元素(过 阅读全文
posted @ 2020-07-27 14:40 Momentt 阅读(86) 评论(1) 推荐(0)