Explore what CodeHS has to offer for districts, schools, and teachers.
Click on one of our programs below to get started coding in the sandbox!
View All
What will be printed to the console when the following program is executed:
function surprise(value) { let x = 0; for (let i = 0; i < value; i++) { x = x + i; } return x; } console.log(surprise(5));
0
5
10
15