08 2019 档案
摘要:首先你要了解设计模式,了解备忘录模式,如果不了解那就先去了解吧. class Cache { // 中间对象 constructor(json) { this.json = json } getJson() { return this.json } } class CacheList { // 缓存
阅读全文
摘要:function getRndInteger(min, max) { return Math.floor(Math.random() * (max - min)) + min; } getRndInteger(1,32) function getRndInteger(min, max) { retu
阅读全文
摘要:对象里的属性求和var result = [ { subject: 'math', score: 10 }, { subject: 'chinese', score: 20 }, { subject: 'english', score: 30 } ]; var sum = result.reduce
阅读全文