Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
function buildArray(n) {
const arr = [];
for (let i = 0; i < n; i++) {
arr.push(i);
}
}
function buildArray2(n) {
const arr = new Array(n).fill(0);
for (let i = 0; i < n; i++) {
arr[i] = (i);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.