Home | Mailing List | Blog | Tutorial Videos

Using Array#flat

Consider the following array get a with depth 5, what will get logged.

const _array = [1,[2,[3,[4,[5,[6,[7],8],9],10]]],12]
const result = _array.flat(5)
console.log(result);

Select one: