CJCoding With Joseph
← Back to Question List
JavaScript Code Walkthrough #1

String Building in a Loop

easyLoops

📄 Code

Read carefully — what does this print?
1let result = "";
2for (let i = 1; i <= 3; i++) {
3 result += i + " ";
4}
5console.log(result.trim());

🎯 Your Answer

Next →