发表于: 2016-07-03 23:47:22
1 2399
今天完成的事情:
1学习了继承、类和原型、 访问和添加公有变量和私有变量,高阶函数之闭包,Date对象使用。
2.ES6的箭头函数和generator
明天计划的事情:
1.复习类和对象
2.学习JS标准对象和面向对象编程。
遇到的问题:
闭包延迟执行不是很懂呢?它使用的最大意义是什么呢?
Object.prototype.objCustom = function () {};
Array.prototype.arrCustom = function () {};
let iterable = [3, 5, 7];
iterable.foo = "hello";
for (let i in iterable) {
console.log(i); // logs 0, 1, 2, "foo", "arrCustom", "objCustom"
}
for (let i of iterable) {
console.log(i); // logs 3, 5, 7
}
评论