Mascara: Next Generation JavaScript compiler

Try it Download Buy About Documentation Blog Contact

for loops

For-loops are used for iteration. There are three kinds of for-loops:

For-in is used to iterate over the property names of an object or the indexes of an array. Read more.

For-each-in is used to iterate over the property values of an object or the elements of an array. Read more.

Classic for loop is used for general looping, using a syntax akin to C-family languages:

   for (var x=100; x>0; x--) print (x + " bottles left.");
There is no changes to the classic for loop in Mascara.
X Try!
Mascara JavaScript Generated JavaScript

Translating...
Show compiler settings