摘要: Using for..of statement:function* greeting(){ console.log(`Generators are "lazy"`); yield "How"; console.log(`I'm not called until the second... 阅读全文
posted @ 2014-11-23 21:37 Zhentiw 阅读(159) 评论(0) 推荐(0) 编辑
摘要: Generators in ECMAscript 6 are first-class coroutines that produce encapsulated suspended execution(暂停执行) contexts.Yield values and iterate over them ... 阅读全文
posted @ 2014-11-23 21:05 Zhentiw 阅读(368) 评论(0) 推荐(0) 编辑
摘要: The spread operator (...) allows you to "explode" an array into its individual elements.Spreate an array:console.log([1,2,3]); // [1, 2, 3] conso... 阅读全文
posted @ 2014-11-23 01:41 Zhentiw 阅读(458) 评论(0) 推荐(0) 编辑
摘要: Where destructuring in ES6 allows you to easily get properties out of an object, this shorthand property syntax allows you to easily push properties i... 阅读全文
posted @ 2014-11-23 01:30 Zhentiw 阅读(328) 评论(0) 推荐(0) 编辑