摘要: /** * A reducer for a single todo * @param state * @param action * @returns {*} */const todo = ( state, action ) => { switch ( action.type ) { ... 阅读全文
posted @ 2016-01-15 16:48 Zhentiw 阅读(318) 评论(0) 推荐(0)
摘要: In JavaScript, you can change the content of a string using thereplacemethod. This method signature is overloaded with a bunch of different ways to do... 阅读全文
posted @ 2016-01-15 02:13 Zhentiw 阅读(244) 评论(0) 推荐(0)
摘要: var input = "foobar";var result = input.replace('bar', '$`'); // $`: replace 'bar' with everything before our match.--> foofoovar input = "foobarbaz"... 阅读全文
posted @ 2016-01-15 02:06 Zhentiw 阅读(566) 评论(0) 推荐(0)
摘要: 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 阅读(229) 评论(0) 推荐(0)