26 lines
270 B
JavaScript
26 lines
270 B
JavaScript
let answer = 42;
|
|
function square(x) {
|
|
return x * x;
|
|
}
|
|
function sum_to(n) {
|
|
{
|
|
const i7 = 0;
|
|
const acc8 = 0;
|
|
{
|
|
let i = i7;
|
|
let acc = acc8;
|
|
while (true) {
|
|
if (i > n) {
|
|
return acc;
|
|
} else {
|
|
const i11 = i + 1;
|
|
const acc12 = acc + i;
|
|
i = i11;
|
|
acc = acc12;
|
|
continue;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|