array for loop in javascript code example
Example 1: javascript for loop
var colors=["red","blue","green"];
for (let i = 0; i < colors.length; i++) {
console.log(colors[i]);
}
Example 2: javascript code to loop through array
var colors = ["red","blue","green"];
for (var i = 0; i < colors.length; i++) {
console.log(colors[i]);
}
Example 3: javascript loop through array
var myStringArray = ["Hello","World"];
var arrayLength = myStringArray.length;
for (var i = 0; i < arrayLength; i++) {
console.log(myStringArray[i]);
}
Example 4: for i
# For loops in Dip
for i = 0 to 5 then print(i)
Example 5: for loop
Coroutine doThisCoroutine;
int duration = 5
float waitTime = 1
void Awake(){
DoThisCoroutine = StartCoroutine(DoThis());
}
IEnumerator DoThis(){
while (enabled){
for (int x = 0; x < Duration; x++){
print("Doing This!");
yield return new WaitForSeconds(waitTime)
}
}
}