Skip to content

Instantly share code, notes, and snippets.

@loktar00
Created August 23, 2012 04:18
Show Gist options
  • Select an option

  • Save loktar00/3432238 to your computer and use it in GitHub Desktop.

Select an option

Save loktar00/3432238 to your computer and use it in GitHub Desktop.
Random Sum function
var sum = function(){
var arr = [].slice.apply(arguments),
total = arr.reduce(function(a,b){
b = parseInt(b);
if(!isNaN(b)){
return a+b;
}else{
return a;
}
});
return total;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment