Check out example codes for "how to link your js file to html". It will help you in understanding the concepts better.

Code Example 1

<script src="myscripts.js"></script>

Code Example 2

<script src="index.js"></script>

Code Example 3

<script src="PathToYourFile.js"> </script>

Learn ReactJs, React Native from akashmittal.com