上一页 1 ··· 422 423 424 425 426 427 428 429 430 ··· 469 下一页
摘要: Learn how to implement adding a todo in a todo list application reducer.let todo = (state = [], action) => { switch(action.type){ case 'ADD_ITEM... 阅读全文
posted @ 2015-12-02 01:53 Zhentiw 阅读(160) 评论(0) 推荐(0) 编辑
摘要: Take away:Always check you ruturn the accumulatorAlways pass in the inital valuevar data = ["vote1", "vote2", "vote1", "vote2"];var reducer = function... 阅读全文
posted @ 2015-12-01 01:31 Zhentiw 阅读(154) 评论(0) 推荐(0) 编辑
摘要: Sometimes we need to turn arrays into new values in ways that can't be done purely by passing an accumulator along with no knowledge about its context... 阅读全文
posted @ 2015-11-30 20:30 Zhentiw 阅读(175) 评论(0) 推荐(0) 编辑
摘要: Learn how to use Object.assign() and the spread operator proposed for ES7 to avoid mutating objects./* * Open the console to see * that the tests have... 阅读全文
posted @ 2015-11-30 03:31 Zhentiw 阅读(326) 评论(0) 推荐(0) 编辑
摘要: Learn how two common array functions - map() and filter() - are syntactic sugar for reduce operations. Learn how to use them, how to compose them, and... 阅读全文
posted @ 2015-11-29 18:00 Zhentiw 阅读(200) 评论(0) 推荐(0) 编辑
摘要: For Redux, you cannot use mutable methods like push, splice. Need to use immutable methods such as concat, slice and ...spreadHtml: JS Bin push(... 阅读全文
posted @ 2015-11-29 01:29 Zhentiw 阅读(932) 评论(0) 推荐(0) 编辑
摘要: Currying is a core concept of functional programming and a useful tool for any developer's toolbelt.Example 1:let f = a => b => c => a+b+c;let result ... 阅读全文
posted @ 2015-11-29 00:50 Zhentiw 阅读(197) 评论(0) 推荐(0) 编辑
摘要: Array slice creates a shallow copy of an array. In this lesson we cover, in detail, exactly what a 'shallow' copy is and how it can trip people up. We... 阅读全文
posted @ 2015-11-27 03:50 Zhentiw 阅读(319) 评论(0) 推荐(0) 编辑
摘要: var parts = ['shoulders', 'knees'];var lyrics = ['head', ...parts, 'and', 'toes']; // ["head", "shoulders", "knees", "and", "toes"]var arr1 = [0, 1, 2... 阅读全文
posted @ 2015-11-27 03:06 Zhentiw 阅读(311) 评论(0) 推荐(0) 编辑
摘要: angular.module('MyApplication', ['ngAnimate']) .controller('ApplicationController', ['$interval', function($interval) { var banner... 阅读全文
posted @ 2015-11-27 01:48 Zhentiw 阅读(481) 评论(0) 推荐(0) 编辑
上一页 1 ··· 422 423 424 425 426 427 428 429 430 ··· 469 下一页