Hacker News new | past | comments | ask | show | jobs | submit login

Though, keep in mind that some of this stuff (most notably the [...arr] syntax) won't work in old browsers if you make a web project (IE 11 is a big offender here). See https://caniuse.com/ for a useful source of info on what will work with what for stuff like that.

If you do web stuff (and you don't want to just say "no IE 11" - some people, and even some big companies, do that!), usually the easiest way to handle stuff like that is to use the newest syntax you're comfortable with, plus a tool like Babel that will produce a "time travel" version with older syntax that will work in all browsers.




This project explicitly says Node. But in any case, these days I generally recommend using Babel to transpile the newer JS to browser friendly JS as the productivity and readability improvements in newer versions of JS are worth the effort to me to set up the babel build step.


> This project explicitly says Node.

While that's true, future projects are a lot easier if one doesn't have to keep re-referencing "what works in Node" vs "what works on the web".


current projects are a lot easier if you can use modern syntax that will eventually be supported in future projects, and which can be transpiled in either way




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: