For Loops

Last updated: Mar 4th, 2018

Introduction

The purpose of for loops in Cuneiform is to loop through arrays.

Looping Through an Array

Array values can be accessed using for-in loops.


var cars = ["Tesla", "Volvo", "BMW"];
var carList = "";
for car in cars {
    carList = carList + " " + car;
}
                                    

In the above example, values of the car array are read and added to a string.

What's next?

The next part discusses system operations in Cuneiform.