Sandy
0
Q:

loop function

let array = ["loop", "this", "array"]; // input array variable
for (let i = 0; i < array.length; i++) { // iteration over input
	console.log(array[i]); // logs the elements from the current input
}
2

var i = 2;
var len = cars.length;
var text = "";
for (; i < len; i++) { 
	// this is a comment
    text += cars[i] + "<br>";

 } 
8
MyString = ""
for i in range(5):
  MyString += "hi"
print(MyString)
4

fruits = ["apple", "banana", "cherry"]
for x in fruits:
	print(x)
 
0

New to Communities?

Join the community