RethinkDB with io.js: exploring ES6 generators and the future of JavaScript(rethinkdb.com)
rethinkdb.com
RethinkDB with io.js: exploring ES6 generators and the future of JavaScript
http://rethinkdb.com/blog/rethinkdbdash-iojs/
1 comments
That can be done via ES6 as well, replacing -> with => and adding parentheses for those lambdas.
True! The only difference are implicit returns and significant whitespace I guess (and trailing same-line conditionals).
(think it'll even have the skinny arrow, the fat one binds `this` too)
(think it'll even have the skinny arrow, the fat one binds `this` too)
JS' fat arrow is also coming, which would give a similarly succinct code.
However, if someone want the compactness of the second example today, CoffeeScript is another alternative:
(obviously the main benefits with generators aren't concise code, but since the article mentioned conciseness I thought I'd post the CoffeeScript equivalent)