Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Loops
//Loops // "for" Loop //Test 1 for(var i = 0; i < 5; i++){ print(i); } //Test 2 - Just for fun for(var a = 0; a <= 7; a++){ print('Just for fun ' +a); } //"while" Loop //Test var b = 0; while(b < 5){ print('wassup '+b); b++; } //"forEach" Loop //create an array: var numbers = [14,56,24,17]; numbers.forEach(function(number){ print(number); }); //loops the numbers as many times as the amount of numbers (.length) -there are 4 for(var p = 0; p < numbers.length; p++){ print(numbers[p]); } // I cant figure out how to use "reverse" : it just prints the numbers in regular order numbers.reverse(function(reverse){ print(reverse); });
run
|
edit
|
history
|
help
0
House prices
Nombre en MAYÚSCULAS
Oh my numbers!
isUniqueChar
Iterator()-function
Star wars ep 3. limit
1
новинка
Rocket Science
JS exam part 2 - Circumference