Created
January 9, 2014 03:35
-
-
Save wolftatsu/8328994 to your computer and use it in GitHub Desktop.
JavaScript
equivalent Σ[k=1..10]k
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(){ | |
function calc() { | |
var num = 0; | |
for (var i=1; i<=10; i++) { | |
// 動きを追うにはconsole.logを色々な所で打ち込んでみよう! | |
console.log(num); | |
num += i; | |
} | |
return num; | |
} | |
var result = calc(); | |
console.log(result); | |
})(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment