Skip to content

Instantly share code, notes, and snippets.

@kyktommy
Created June 12, 2020 04:50
Show Gist options
  • Save kyktommy/3b7baffe6831588919280e0328643986 to your computer and use it in GitHub Desktop.
Save kyktommy/3b7baffe6831588919280e0328643986 to your computer and use it in GitHub Desktop.
faster javascript methods
// remove from array, no seq
// https://jsperf.com/array-remove-by-index
var arr = [1,2,3]
var index = arr.indexOf(2)
arr[index] = arr[arr.length - 1]
arr.pop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment