LoOP code code example
Example 1: for loop
for(int i = 0; i < some_number; i++){
}
Example 2: loop javascript
for (var i = 0; i < cats.length; i++) {
if (i === cats.length - 1) {
info += 'and ' + cats[i] + '.';
} else {
info += cats[i] + ', ';
}
}
Example 3: for loops
MyString = ""
for i in range(5):
MyString += "hi"
print(MyString)
Example 4: code for loop
for (initializationStatement; testExpression; updateStatement)
{
}
Example 5: loops javascript
function loopy() {
while(true) {
console.log("Hello, world!");
}
}
function myFunc() {
for (let i = 1; i <= 4; i += 2) {
console.log("Still going!");
}
}