Check out example codes for "get length of vector rust". It will help you in understanding the concepts better.

Code Example 1

let a = vec![1, 2, 3];
assert_eq!(a.len(), 3);

Code Example 2

let mut vec = Vec::new();

Learn ReactJs, React Native from akashmittal.com