Array.prototype.flat
uses 1
as the argument if you pass undefined
or do not provide a value.
This means that .flat(1)
is the same as .flat()
, making the argument unnecessary.
array.flat(1);
const one = 1;
array.flat(one);
array.flat();
const one = 1;
array.flat();
let levels = 1; // Mutable variable, might be reassigned later
array.flat(levels);
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