Return to Snippet

Revision: 20067
at November 5, 2009 21:54 by arunpjohny


Initial Code
if(typeof Array.prototype.size != 'function'){
			Array.prototype.size = function(){
				return this.length;
			}
		}

Initial URL


Initial Description
This can be tested using the following piece of code

		var a = [1, 2, 3, 4, 5];
		alert(a.size());

Initial Title
Array.size function

Initial Tags
javascript, array

Initial Language
JavaScript