Skip to content

Instantly share code, notes, and snippets.

@rcstr
Created June 29, 2013 16:35
Show Gist options
  • Save rcstr/5891772 to your computer and use it in GitHub Desktop.
Save rcstr/5891772 to your computer and use it in GitHub Desktop.
function sumNumber(numberToSum) {
var numbers = [];
for(var i = 0; i<numberToSum; i++) {
numbers.push(i+1);
}
return eval(numbers.join('+'));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment