Skip to content

Instantly share code, notes, and snippets.

@nenjiru
Created January 15, 2013 05:25
Show Gist options
  • Save nenjiru/4536363 to your computer and use it in GitHub Desktop.
Save nenjiru/4536363 to your computer and use it in GitHub Desktop.
Array extension
/*
* Array clone
*/
Array.prototype.clone = function()
{
return this.concat([]);
}
/*
* Max value (only number
*/
Array.prototype.max = function() {
return Math.max.apply(null, this);
}
/*
* Min value (only number
*/
Array.prototype.min = function() {
return Math.min.apply(null, this);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment