Created
November 2, 2017 15:55
-
-
Save akabab/7a530deb9dc5bc0e700ce682b310244d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 2d Arrays | |
const Array2d = (w, h = w, fillWith = undefined) => | |
Array(h).fill(fillWith).map(e => e = Array(w).fill(fillWith)) | |
// 2D array fill of 0 | |
Array(10).fill(0).map(e => e = Array(10).fill(0)) | |
// -> | |
Array2d(10, 10, 0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment