-
-
-
-
-
-
-
- Array.prototype.indexOf = function (val) {
- for (var i = 0; i < this.length; i++) {
- if (this[i] == val) {
- return i;
- }
- }
- return -1;
- };
- Array.prototype.removevalue = function (val) {
- var index = this.indexOf(val);
- if (index > -1) {
- this.splice(index, 1);
- }
- };
-
-
-
-
-
-
-
-
-
- Array.prototype.remove = function (dx) {
- if (isNaN(dx) || dx > this.length) {
- return false;
- }
- for (var i = 0, n = 0; i < this.length; i++) {
- if (this[i] != this[dx]) {
- this[n++] = this[i];
- }
- }
- this.length -= 1;
- };
posted @
2014-05-19 15:57
往昔-安安
阅读(
151)
评论()
编辑
收藏
举报