News for hackers. Stuff that matters.
Re:What’s New in ES2019 by intea on Tuesday July 30, 2019 @08:08AM (#20564062)
Why are empty elements in an array allowed? oO

[1,2,,3]

Re:What’s New in ES2019 by vbezhenar on Tuesday July 30, 2019 @08:11AM (#20564077)
They need to ensure that any combination of characters will produce some result.
Re:What’s New in ES2019 by padolsey on Tuesday July 30, 2019 @08:37AM (#20564230)
Quite useful in situations such as:

> (str.match(regexWithGroup) || [, null])[1]

I.e. if the regex matches, then give me the first group (1st index) otherwise give me null.

Re:What’s New in ES2019 by bzbarsky on Tuesday July 30, 2019 @01:38PM (#20567169)
Because you can create that array anyway, like so:

  var arr = [];
  arr[0] = 1;
  arr[1] = 2;
  arr[3] = 3;
so there's not really much downside to also allowing a literal syntax for the same thing.