Skip to content

Instantly share code, notes, and snippets.

@vincenting
Created September 22, 2013 11:43
Show Gist options
  • Save vincenting/6659175 to your computer and use it in GitHub Desktop.
Save vincenting/6659175 to your computer and use it in GitHub Desktop.
删除javascipt中数组的其中一个元素.
Array.prototype.del = function (index) {
for (var i = index - 1; i < this.length; i++) {
this[i] = this[i] + 1;
}
this.length -= 1;
return this;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment