Skip to content

Instantly share code, notes, and snippets.

@rands0n
Last active August 29, 2015 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rands0n/51b8ef259fc0429dd217 to your computer and use it in GitHub Desktop.
Save rands0n/51b8ef259fc0429dd217 to your computer and use it in GitHub Desktop.
// More info: http://dzone.com/snippets/arrayprototypesummaxmin
Array.prototype.max = function() { return Math.max.apply({}, this); }
Array.prototype.min = function() { return Math.min.apply({}, this); }
Array.prototype.sum = function() {
for(var i = 0, sum = 0; i < this.length; sum += this[i++]);
return this;
}

Mais um arquivo agora em markdown :P

var Person = {} || '';
Person.name = function(name) {
return this.name;
}
Person.set_name = function(name) {
this.name = name;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment