Answers for "9.4.1.1. Initial Expression¶ // Loop Examples"

0

9.4.1.1. Initial Expression¶ // Loop Examples

//This loop prints 3...9.

for (let i = 3; i < 10; i++) {
   console.log(i);
}


//This loop prints each of the letters C, o, d, and e on a separate line.

let name = "LaunchCode";

for (let i = 6; i < name.length; i++) {
   console.log(name[i]);
}

/*The loop variable is typically used by the loop body, but this is 
not required. The following example is a valid for loop that prints
"LaunchCode" 42 times.*/

for (let i = 0; i < 42; i++) {
   console.log("LaunchCode");
}
Posted by: Guest on June-17-2021

Code answers related to "9.4.1.1. Initial Expression¶ // Loop Examples"

Code answers related to "Javascript"

Browse Popular Code Answers by Language