Javascript Array extensions


This is a collection of prototypes to extend the Array objects. When including these in your code you will be able to use them as Array member functions.


Array.prototype.deleteElement = function (el)
{
	var i = this.indexOf(num);
	if(i != -1)
		this.splice(i, 1);
}


Array.prototype.deleteAt = function (i)
{
	this.splice(i, 1);
}

Array.prototype.lastElement = function()
{
	return this[this.length -1];
}

Last update: July 02 2008
[Contact] [XHTML]
Copyright © Infosnel.nl