上一页 1 ··· 444 445 446 447 448 449 450 451 452 ··· 496 下一页
摘要: 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 阅读(519) 评论(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 阅读(267) 评论(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 阅读(269) 评论(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 阅读(429) 评论(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 阅读(182) 评论(0) 推荐(0)
摘要: A common problem when dealing with some kinds of data is that not every object has the same nested structure. lukeskywalker.parents.father.isjedi work... 阅读全文
posted @ 2016-01-14 03:19 Zhentiw 阅读(171) 评论(0) 推荐(0)
摘要: Map is really useful when you want to use object as a key to set vaule, in ES5, you cannot really use object as a key:var user1 = { name: "Wan", age... 阅读全文
posted @ 2016-01-13 02:42 Zhentiw 阅读(370) 评论(0) 推荐(0)
摘要: /** * A reducer for a single todo * @param state * @param action * @returns {*} */const todo = ( state, action ) => { switch ( action.type ) { ... 阅读全文
posted @ 2016-01-12 19:49 Zhentiw 阅读(420) 评论(0) 推荐(0)
摘要: Learn how to create a React todo list application using the reducers we wrote before./** * A reducer for a single todo * @param state * @param action ... 阅读全文
posted @ 2016-01-12 18:11 Zhentiw 阅读(414) 评论(0) 推荐(0)
摘要: Sometimes we want to test our Redux reducers to make sure they work as expected. In this lesson we will walk through setting up some Redux reducer tes... 阅读全文
posted @ 2016-01-12 03:21 Zhentiw 阅读(240) 评论(0) 推荐(0)
上一页 1 ··· 444 445 446 447 448 449 450 451 452 ··· 496 下一页