News for hackers. Stuff that matters.
Re:Click by a1371 on Friday March 19, 2021 @07:05PM (#26519070)
The spread operator does not have the same quirk. I use it but it's still a bit weird tough

[...new Array(1000)].map(something)

Re:Click by ficklepickle on Saturday March 20, 2021 @01:57AM (#26521094)
You can drop the new

[...Array(1000)]

I think that is the least bits. Would love to be proven wrong :D

Re:Click by franky47 on Saturday March 20, 2021 @02:06AM (#26521138)
It may be shorter, but I like the spread syntax best used sparingly, it's harder to grasp why it was necessary there at a glance.

That's what I like in the elegance of Array.from({ length: 1000 }): it's a hack, but it reads naturally.

Re:Click by antonvs on Sunday March 21, 2021 @07:38PM (#26535162)
"Harder to grasp" only lasts until you're mildly familiar with the idiom.
Re:Click by trehalose on Saturday March 20, 2021 @07:45PM (#26526943)
[...Array(1e3)]