Skip to content

Instantly share code, notes, and snippets.

Matt Walterspieler walterspieler

Block or report user

Report or block walterspieler

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am walterspieler on github.
  • I am mwalterspieler (https://keybase.io/mwalterspieler) on keybase.
  • I have a public key ASBfGz9PXaqPTreYdoOLLVndQejLW2jbxGgYKoFguTyucQo

To claim this, I am signing this object:

View using-Array.prototype.flat().js
const multiDimensionalArray = [ [1, 2], [3, 4], [5, 6] ];
const flattenedArray =multiDimensionalArray.flat();
console.log(flattenedArray) // [1, 2, 3, 4, 5, 6]
// This methods accepts one argument to choose the depth of the flattening.
const multiDimensionalArray = [[ [1, 2]], [3, 4], [5, 6] ];
multiDimensionalArray.flat(2);
console.log(flattenedArray) // [1, 2, 3, 4, 5, 6]
You can’t perform that action at this time.