Basic Array Functions
Let's learn some of the fundamental functions of the array data structure.
We'll cover the following...
Array Length
The length of an array can be calculated using the Array.length()
utility.
Press + to interact
let arr = Array.make(10, 0);Js.log(Array.length(arr));
Accessing Elements
An array element can be accessed using its index. This is also known as indexing. We simply have to enclose the index in []
brackets and ...