-
-
Save henryspivey/e5764632a0aa949381de0f7bc3e8a744 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
//version 1 | |
let a1 = Array.from({ | |
length: 5 | |
}, n => Math.random()); | |
console.log('1', a1); | |
//version 2 | |
let a2 = new Array(5).fill(1).map(n => Math.random()); | |
console.log('2', a2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment