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

Oh yeah - short function syntax goes into the wild!

    let square = x => x * x
Time to move over to stalking the Chrome devs...



Not to mention that |this| is lexically bound in the case of fat arrow functions. No more ".bind(this)" or "let self = this;" everywhere!

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...


Yay. Sometimes I wish we still did release parties.


Can this syntax be also used with the other browsers? i.e. IE and Chrome?


Not yet, but it is in the ECMAScript 6 draft, so it will most likely be adopted eventually.


TypeScript supports this syntax. I believe they are trying to align with ECMAScript 6 as much as possible.


The nice thing about TypeScript is that it compiles to EcmaScript 3, so you can target older browsers and still use these goodies.

Also, TypeScript 0.9 is released, which includes niceties such as generics and type info overloading based on constant values passed in function parameters.

It's pretty slick, if only it could output code optimized for Google Closure's advanced mode, for tree-shaking awesomeness.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: