Live data from Hacker News

Ask HN: If you targetting ES6 by default, how did you rationalize that choice?

news.ycombinator.com

61–62 of 62 posts

Re: Ask HN: If you targetting ES6 by default, how did you rationalize that choice?

#61

Earlier quoted context omitted.

You know what's weird, I don't like the arrow functions in es6. And, I'm a coffeescript guy. I just don't like that the syntax is conditional on so many different things. The number of parameters, line length, etc... I just wrote this function and used `function` rather than `=>` because I couldn't get the syntax right using an arrow function: const showTable = ["email", "phone", "website"].reduce( function (previous…

Well for one you're missing a closing } in that function. But you could just do const showTable = ["email", "phone","website"] .reduce((previous, channel) => { return previous || !!institution[channel] && !/^\s*$/.test(institution[channel]) }), false) You can always just replace function() { with () => { and the only difference between the two would be binding this. Or you could do this: const showsTable = ["email",…

But, that's kinda my point. You shouldn't need the { for a one line function.

also, I tried the solution you gave and it doesn't work :(

Re: Ask HN: If you targetting ES6 by default, how did you rationalize that choice?

#62

Earlier quoted context omitted.

You know what's weird, I don't like the arrow functions in es6. And, I'm a coffeescript guy. I just don't like that the syntax is conditional on so many different things. The number of parameters, line length, etc... I just wrote this function and used `function` rather than `=>` because I couldn't get the syntax right using an arrow function: const showTable = ["email", "phone", "website"].reduce( function (previous…

FWIW, Array.prototype.some() would probably be more idiomatic here.

Where were you on my code review :) Great suggestion.
Post reply on HN