eslint-plugin-array-func icon indicating copy to clipboard operation
eslint-plugin-array-func copied to clipboard

Prefer filling over spreading a new array with a size

Open freaktechnik opened this issue 6 years ago • 1 comments

Yeah, let's avoid doing the proposed solution in https://itnext.io/heres-why-mapping-a-constructed-array-doesn-t-work-in-javascript-f1195138615a and use filling instead.

freaktechnik avatar Jun 17 '18 10:06 freaktechnik

Alternatives would also be Array.from({ length: size }, (u, i) => map(i)); or similar.

freaktechnik avatar Jun 17 '18 10:06 freaktechnik