Check out example codes for "how to print an array in cpp in single line". It will help you in understanding the concepts better.

Code Example 1

int Grades[5] = { 3, 2, 5, 2 };

cout << "Grades: ";
for (int i = 0; i < sizeof(Grades)/sizeof(int); i++) {
    cout << Grades[i] << ", "; //minus the commas, remove (<< ", ") or to space out the grades, just remove the comma
}

Learn ReactJs, React Native from akashmittal.com