Skip to content

Instantly share code, notes, and snippets.

@XingMXTeam
Last active April 16, 2018 12:50
Show Gist options
  • Save XingMXTeam/573f33c7de873166534d8643bda74af9 to your computer and use it in GitHub Desktop.
Save XingMXTeam/573f33c7de873166534d8643bda74af9 to your computer and use it in GitHub Desktop.
another Array.splice implement which is 1.5x faster
function spliceOne(list, index) {
for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1)
list[i] = list[k];
list.pop();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment