Prefer Array.from(arrayLike, mapFn)
over Array.from(arrayLike).map(...)
Prefer directly using Array.from
mapFn
argument instead of an extra map
.
This is supposed to improve performances.
const foo = Array.from(bar).map(baz);
const foo = Array.from(bar).map((element, i) => baz(element, i));
const foo = Array.from(bar, baz);
const foo = Array.from(bar, (element, i) => baz(element, i));
prefer-array-from-map-fn
This should be automatically fixable by the --fix CLI option.
This looks π€ a bit related to:
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too