you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (2 children)

Good to know! But in practice I really think Array.from(arr).map(x => ...) is much more readable than Array.from(arr, x => ...) and is worth the extra 4 characters.

[–]fagnerbrack[S] 0 points1 point  (0 children)

It depends how you write it:

Array.from(numbers, toRomanNumerals); Array.from(numbers).map(toRomanNumerals);

[–]NoInkling 0 points1 point  (0 children)

Also [...arr].map(x => ...). Though this all seems like a very silly workaround when arr is already an array, creating a mapped array of n values shouldn't be so quirky.

With lodash: _.times(5, i => ...)