jQuery.fn.yourFunctionName = function() {
// `this` is the jQuery Object on which the yourFunctionName method is called.
// `arguments` will contain any arguments passed to the yourFunctionName method.
var firstElement = this[0];
return this; // Needed for other methods to be able to chain off of yourFunctionName.
};
/* This prototype example allows you to remove array from array */
Array.prototype.remove = function(x) {
var i;
for(i in this){
if(this[i].toString() == x.toString()){
this.splice(i,1)
}
}
}
----> Now we can use it like this :
var val=10;
myarray.remove(val);