Check out example codes for "add script html". It will help you in understanding the concepts better.

Code Example 1

<html>
  <head>
    <script type="text/javascript" src="/path/to/script.js"></script>
    ...

Code Example 2

<script src¨script.js¨></script>

Code Example 3

<script>

document.getElementById("demo").innerHTML = "My First JavaScript";

</script>

Code Example 4

<script>
	//JavaScript here
</script>

Code Example 5

<script type="text/javascript" src="/path/to/script.js"></script>

Code Example 6

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

Learn ReactJs, React Native from akashmittal.com