Instantly share code, notes, and snippets.

Embed
What would you like to do?
// Generated by CoffeeScript 1.9.3
(function() {
var i, j, k, l, sum, total;
sum = 0;
for (i = j = 0; j <= 9; i = ++j) {
sum += i;
}
console.log(sum);
sum = 0;
for (i = k = 0; k <= 9; i = ++k) {
sum += i;
}
console.log(sum);
sum = 0;
for (i = l = 0; l <= 9; i = l += 2) {
sum += i;
}
console.log(sum);
sum = 0;
total = (function() {
var m, results;
results = [];
for (i = m = 0; m <= 9; i = ++m) {
results.push(sum += i);
}
return results;
})();
console.log(total);
i = 0;
sum = 0;
while (i < 10) {
sum += i;
i++;
}
console.log(sum);
}).call(this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment