Created
November 27, 2016 08:14
-
-
Save EncodeTheCode/be72ab563c8b9afdc6f832f9cf7aa4e7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array.prototype.sum=function(s){if(typeof s!=='function'){s=function(p){return p;}}var v=0;for(var i=0;i<this.length;i++){v+=parseFloat(s(this[i]));}return v;}; | |
function calc(num,stat){ | |
for (i=0;i<num.length;i++){ | |
return num.sum()+" "+stat; | |
} | |
} | |
calc([1491+1172+801+200+1563+1110+973+1068+1491+1119+1486],"Agility"); // "12474 Agility" | |
calc([1491,1172,801,200,1563,1110,973,1068,1491,1119,1486],"Agility"); // "12474 Agility" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment