Check out example codes for "how to put the contents of a file into an array in bash". It will help you in understanding the concepts better.

Code Example 1

IFS=$'\n' read -d '' -r -a lines < /path/to/file

Learn ReactJs, React Native from akashmittal.com