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:
people.map(function (person) { return person.age; }));
people.map(person => person.age);
Why? Why a fat arrow... why not the other way? <=
Then there is
let, which is similar to
my but you seem to still be able to mix
var in and create a scope mess...
They also use modules, with named import's (just like in perl you can require certain things from a pm).
And the templating... oh noes... the templating uses backtick/backquote...
var name = 'John';
var age = 29;
return `My name is ${ name }, in a year I will be ${ age + 1 } years o
+ld`;
Interested in reading more about JS6? Here is a link:
ecmascript6-introduction
Now leave me be... I'm drowning my pain in beer...
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.