At approximately 1:51 in the video, take note of how she inserts a <script>
tag? The process is pretty straightforward:
Start by creating an html file (basically a text file with a .html
extension) on your computer. In the same directory where you have your index.html
file, place a javascript file (just another text file but with a .js
extension - let's name it game.js
). Next, inside your index.html
file, add some html code that includes the script tag linking to the game.js
file, similar to what Mary demonstrated in the video. Your index.html
should resemble something like this:
<html>
<head>
<script src="game.js"></script>
</head>
</html>
Afterwards, simply double-click on that file in finder, and it will open up in your browser. To access the console for viewing the output of your javascript code, press Command-alt-j (all three buttons simultaneously).
Wishing you good luck on your coding journey! I hope you find it as enjoyable as I have so far :)