Skip to content

Instantly share code, notes, and snippets.

@XingMXTeam
Last active April 16, 2018 12:50
Show Gist options
  • Select an option

  • Save XingMXTeam/573f33c7de873166534d8643bda74af9 to your computer and use it in GitHub Desktop.

Select an option

Save XingMXTeam/573f33c7de873166534d8643bda74af9 to your computer and use it in GitHub Desktop.

Revisions

  1. XingMXTeam revised this gist Apr 16, 2018. No changes.
  2. XingMXTeam created this gist Apr 16, 2018.
    5 changes: 5 additions & 0 deletions spliceOne.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    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();
    }