Check out example codes for "rust lang make array". It will help you in understanding the concepts better.

Code Example 1

let mut array: [i32; 3] = [0; 3];

array[1] = 1;
array[2] = 2;

assert_eq!([1, 2], &array[1..]);

// This loop prints: 0 1 2
for x in &array {
    print!("{} ", x);
}

Learn ReactJs, React Native from akashmittal.com