Skip to content

Instantly share code, notes, and snippets.

@bingeboy
Last active December 17, 2015 17:49
Show Gist options
  • Save bingeboy/5648450 to your computer and use it in GitHub Desktop.
Save bingeboy/5648450 to your computer and use it in GitHub Desktop.
JS Arrays
//largest value in array
Array.max = function( array ){
return Math.max.apply( Math, array );
};
//add multiple array values
function addArrayValues(arrayNameHere){
var i
, max
, statTotal = [];
sum=0; max=arrayNameHere.length; i=max; while(i--) sum += roll[i];
statTotal.push(sum);
return statTotal
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment