Created
October 31, 2020 02:29
-
-
Save LarryLuTW/e7645a46eec1c7da816a64e84256453c to your computer and use it in GitHub Desktop.
This file contains 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
function sum_to_x(x) { | |
let sum = 0 | |
for(let i=0; i <= x; i++) { | |
sum += i | |
} | |
return sum | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment