Created
October 11, 2019 16:52
-
-
Save greathmaster/bd048bd762ec6db4a20d48490b7d7e8c to your computer and use it in GitHub Desktop.
Fill/initialize a 2D JS array
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
//Fill/initialize a 2D JS array | |
//From: https://www.quora.com/In-JavaScript-how-do-you-create-an-empty-2D-array | |
var twoDArray = Array(2).fill(null).map(()=>Array(2).fill(null)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment