for loop in a for loop code example
Example 1: for loop
for (let i = 0; i < array.length; i++) {
}
Example 2: for loops
MyString = ""
for i in range(5):
MyString += "hi"
print(MyString)
Example 3: for loop
fruits = ['apple', 'orange', 'peach']
for fruit in fruits:
print(fruit)
Example 4: 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)
}
}
}