上一页 1 ··· 416 417 418 419 420 421 422 423 424 ··· 469 下一页
摘要: Learn how to use array reduction to create functional pipelines by composing arrays of functions.const increase = (input) => { return input + 1;}cons... 阅读全文
posted @ 2016-01-15 01:37 Zhentiw 阅读(221) 评论(0) 推荐(0) 编辑
摘要: Example 1:function *topicList(){ yield "ES2015"; yield "Semi-colons: good or bad?"; yield "TypeScript";}for( let topic of topicList() ){ console.l... 阅读全文
posted @ 2016-01-14 21:16 Zhentiw 阅读(190) 评论(0) 推荐(0) 编辑
摘要: Iterables return an iterator object. This object knows how to access items from a collection 1 at a time, while keeping track of its current position ... 阅读全文
posted @ 2016-01-14 21:07 Zhentiw 阅读(168) 评论(0) 推荐(0) 编辑
摘要: How to use:export default function getReplies(topicId){ return new Promise(function( resolve, reject ){ _getRepliesForTopic(topicId, function(data... 阅读全文
posted @ 2016-01-14 20:54 Zhentiw 阅读(184) 评论(0) 推荐(0) 编辑
摘要: Export variable:export const MAX_USERS = 3;export const MAX_REPLIES = 3;Export default class:export default class FlashMessage { constructor(message)... 阅读全文
posted @ 2016-01-14 20:34 Zhentiw 阅读(1263) 评论(0) 推荐(0) 编辑
摘要: Default export:Default export is easy way to export a function to outside module.//flash-message.jsexport default function(message){ alert(message);... 阅读全文
posted @ 2016-01-14 20:17 Zhentiw 阅读(507) 评论(0) 推荐(0) 编辑
摘要: In constructor, you can call parent's constuctor() method by supert();class ShoppingCart { constructor(userId){ this.userId = userId; this.prod... 阅读全文
posted @ 2016-01-14 20:02 Zhentiw 阅读(260) 评论(0) 推荐(0) 编辑
摘要: Limitations With ArrayArrays don't enforce uniqueness of items. Diplicate entries are allowed.Using Setslet tags = new Set() ;tags.add('Javascript');t... 阅读全文
posted @ 2016-01-14 04:11 Zhentiw 阅读(264) 评论(0) 推荐(0) 编辑
摘要: WeakMap: is a type of Map where only objects can be passed as keys. Primitive data type -- such are string, numbers, booleans, etc --- are not allowed... 阅读全文
posted @ 2016-01-14 04:07 Zhentiw 阅读(423) 评论(0) 推荐(0) 编辑
摘要: Use Maps when keys are unknown until runtime:Map:let recentPosts = new Map();createPost( newPost, (data)=>{ // Key unknown until runtime, so use Ma... 阅读全文
posted @ 2016-01-14 03:35 Zhentiw 阅读(170) 评论(0) 推荐(0) 编辑
上一页 1 ··· 416 417 418 419 420 421 422 423 424 ··· 469 下一页