(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| function mapValues(obj, fn) { | |
| return Object.keys(obj).reduce((result, key) => { | |
| result[key] = fn(obj[key], key); | |
| return result; | |
| }, {}); | |
| } | |
| function pick(obj, fn) { | |
| return Object.keys(obj).reduce((result, key) => { | |
| if (fn(obj[key])) { | 
| function *something(msg) { | |
| msg += yield msg; // yields "a", returns "b" | |
| msg += yield msg; // yields "ab", returns "c" | |
| msg += yield msg; // yields "abc", returns "d" | |
| return msg; // returns "abcd" | |
| } | |
| var gen = something('a'); | |
| console.log(gen.next().value); // a | |
| console.log(gen.next('b').value); // ab | 
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.