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
Which of the following programs creates an infinite loop?
let j = 1; for (let i = 0; i < j; i++) { console.log(“hi”); j++; }
while (true) { console.log(“hi”); }
let x = 10; let y = 20; while (x <= y) { console.log(“hi”); x + 1; }
They all create an infinite loop