+ 1

Javascript Question for loops

This is the code I wrote to list all hotel rooms in the console for a Sololearn practice project using console.log and using a new line for each hotel room. I should remove hotel room 13 from the loop. So far so good, but I get an error message every time. I can't get a line break with + '<br/>' or without this addition. I am really desperate. On the internet I find that the br function only exists for document.write functions var countOfRooms = 15; var i = 0; for (i = 0; i <= countOfRooms; i++) { if (i == 13) { continue; } console.log(i); //console.log(i + '\n'); both Versions dont work //console.log(i + '<br/>'); both Versions dont work }

3rd Mar 2024, 4:41 PM
Deniz Lier
Deniz Lier - avatar
1 Réponse
+ 1
Describe the task, or give an example of the intended output.
3rd Mar 2024, 5:12 PM
Solo
Solo - avatar