How would you add a JavaScript file in index.html ?
so there are 2 ways of doing this :
1. create a JavaScript file let's say x.js . now in index.html , you can give path of this javascript file inside a script tag.
2. you can write the script directly in script tag .