Check out example codes for "find last element of an array c++". It will help you in understanding the concepts better.

Code Example 1

int arr={1,2,3,4,5,6};
int length=sizeof(arr)/sizeof(int);
int lastElement=aar[length-1];

Code Example 2

a = [1,2,3,4,5,6,7]
int x = a.size()
// last element of list 
a[x-1] // ourput -> 7

Learn ReactJs, React Native from akashmittal.com