The code in script.js
has syntax errors. Hunt them down and fix them!
- Run the code in
script.js
(see below); - Check the console/terminal for errors;
- Find the line number of the error;
- Using your knowledge of js variables, fix the problems so the file runs without error.
Note: there might also be a logic error in the code!
To run script.js
from the browser:
-
Download or clone this Gist into your workspace;
-
In this new directory, create a valid
index.html
file; -
In the
<head>
ofindex.html
, link toscript.js
with a<script>
tag:<script src="script.js" type="module">
-
Run
index.html
in the browser of your choice; -
Open the Web Console to view the output.
Alternatively, if you have Node installed, script.js
can be run from the command line:
- Download or clone this Gist into your workspace;
- Navigate to this directory from the command line;
- Run the file using Node:
$ node script.js