Seeking clarification on this inquiry. I am a complete novice when it comes to coding.
Currently, I have implemented the following do while loop code taken from w3s:
var text = "";
var i = 1;
do {
text += "The number is " + i;
i++;
}
while (i < 3);
I decided to enhance my understanding by incorporating console.log, as shown below.
var text = "";
var i = 1;
do {
text += "The number is " + i;
i++;
console.log(text);
}
while (i < 3);
The output of the console log displays the following result: The number is 1 The number is 1The number is 2
Query Is there a way to adjust the console log output so that my results (e.g., The number is 1The number is 2) are displayed on separate lines? Is it feasible to modify the console log behavior like so: The number is 1 The number is 2 ...
Appreciate your assistance! :)