Created
April 7, 2018 23:32
-
-
Save idmontie/3df2ec21d04e76d5e0f60162a13c11c8 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
function createMatrix(a = 1, b = a) { | |
return Array.from({ length: a }, () => Array.from({ length: b }, () => 0)); | |
} | |
// 1 x 10 Matrix | |
console.log(createMatrix(1, 10)); | |
// Square Matrix | |
console.log(createMatrix(3)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment