How to connect index.js to a file code example
Example 1: import script html
<html>
<head>
<script type="text/javascript" src="/path/to/script.js"></script>
...
Example 2: link js file to index.html
<script src="your js file"></script>