Skip to content
Quiz · Conditions and loops · lesson 9 of 13

Quiz — for…in and for…of

What does the program print?

JavaScript
const letters = ["x", "y"];
let out = "";
for (const i in letters) {
    out += i;
}
for (const ch of letters) {
    out += ch;
}
console.log(out);

Subscribe to take the course

The course is free. Sign in with Telegram and subscribe to the channel to open every lesson.

Sign in another way