---
title: "Jquery array remove "
author: "夜鸣猪"
date: "2013-04-10T21:38:48Z"
tags: []
categories: ["编程语言"]
slug: "jquery-array-remove"
draft: false
lastmod: "2013-04-10T21:38:48Z"
id: 1845391
url: "https://hlee.iteye.com/blog/1845391"
---

```js


Array.prototype.remove = function(el){
    return this.splice(this.indexOf(el),1);
}
var arr = [1,2,3,4,5];
arr.remove(4);
console.log(arr);//[1,2,3,5]

var array = [1,2,3,4,5];
array.splice(2,1);
console.log(array);//[1,2,4,5]

y.splice( $.inArray(removeItem, y), 1 );


$(window).load(function () {
// run code
});


$('img.userIcon').load(function(){
if($(this).height() > 100) {
$(this).addClass('bigImg');
}
});

```




http://forum.jquery.com/topic/document-ready-and-window-onload-difference