Harmony... that's what the upcomming JS is called. It has some new syntax... and it's perl syntax... but does something totally different! So let me show you why I will be confused for the years to come:
These 2 things are equivalent:
Why? Why a fat arrow... why not the other way? <=people.map(function (person) { return person.age; })); people.map(person => person.age);
var name = 'John'; var age = 29; return `My name is ${ name }, in a year I will be ${ age + 1 } years o +ld`;
Now leave me be... I'm drowning my pain in beer...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: What's new in ECMAScript6, or: Oh no! Don't steal syntax from Perl!
by wrog (Friar) on May 30, 2015 at 19:50 UTC | |
by LanX (Saint) on May 30, 2015 at 23:51 UTC | |
by wrog (Friar) on Jun 01, 2015 at 15:20 UTC | |
|
Re: What's new in ECMAScript6, or: Oh no! Don't steal syntax from Perl!
by LanX (Saint) on May 30, 2015 at 10:07 UTC | |
|
Re: What's new in ECMAScript6, or: Oh no! Don't steal syntax from Perl!
by morgon (Priest) on May 30, 2015 at 23:02 UTC | |
|
Re: What's new in ECMAScript6, or: Oh no! Don't steal syntax from Perl!
by locked_user sundialsvc4 (Abbot) on Jun 01, 2015 at 12:28 UTC |