Skip to content

Instantly share code, notes, and snippets.

@nairihar
Last active June 23, 2018 18:39
Show Gist options
  • Save nairihar/2f86209fc23359829fec24ba1c70c7ef to your computer and use it in GitHub Desktop.
Save nairihar/2f86209fc23359829fec24ba1c70c7ef to your computer and use it in GitHub Desktop.
JavaScript series, part 1, Set, medium
console.time('Array test');
const arr = [];
const count = 10;
for (let i = 0; i < count; i++) {
arr.push(i);
}
for (let i = 1; i < count; i+=2) {
arr.splice(arr.indexOf(i), 1);
}
console.timeEnd('Array test');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment