Created
June 28, 2019 16:32
-
-
Save prof3ssorSt3v3/9deed3aacb2cbab9158cf6daa2bb9b10 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