摘要:
Array.prototype.includes let arr = ['react', 'angular', 'vue'] // Correct if (arr.includes('react')) { console.log('Can use React') } Exponentiation O 阅读全文
posted @ 2019-04-01 17:59
Candice&Gladys
阅读(110)
评论(0)
推荐(0)
摘要:
Array.from对象转数组 let map1 = new Map();map1.set('k1',1);map1.set('k2',2);map1.set('k3',3);let array = Array.from(map1);array.forEach((item, index)=>{ co 阅读全文
posted @ 2019-04-01 17:42
Candice&Gladys
阅读(125)
评论(0)
推荐(0)
摘要:
对象的扩展 let obj = {a: 1, b: 2, c: 3, d: 4}; Object.keys(obj).forEach((key,index)=>{ console.log(key); }); // a b c d let obj = {a: 1, b: 2, c: 3, d: 4}; 阅读全文
posted @ 2019-04-01 16:28
Candice&Gladys
阅读(119)
评论(0)
推荐(0)
摘要:
let [va,vb,vc] = [12,'hello',[3,4]]; // va=12, vb='hello',vc=[3,4] 默认参数 let [x,y='b',c=true] = ['a',undefined]; // x='a', y='b', c=true let {x1, y1 = 阅读全文
posted @ 2019-04-01 16:27
Candice&Gladys
阅读(138)
评论(0)
推荐(0)
摘要:
ECMAScript(js语言规范) ###ES5 1. 严格模式 运行模式: 正常(混杂)模式与严格模式 应用上严格模式: ‘strict mode’ 2、JSON对象 * JSON.stringify(obj/arr) js对象(数组)转换为json对象(数组) * JSON.parse(jso 阅读全文
posted @ 2019-04-01 16:15
Candice&Gladys
阅读(169)
评论(0)
推荐(0)
摘要:
1. 构造器 实例化方式一样 阅读全文
posted @ 2019-04-01 13:15
Candice&Gladys
阅读(81)
评论(0)
推荐(0)
摘要:
首先提供构造函数 1. 构造函数实现继承 原理:改变函数上下文实现继承(call,apply,return,bind) return {}/function(){} 如果返回值是对象 那么this指向这个对象 如果返回值不是一个对象 那么this指向函数的实例 null/undefine/1 虽然n 阅读全文
posted @ 2019-04-01 11:48
Candice&Gladys
阅读(159)
评论(0)
推荐(0)

浙公网安备 33010602011771号