Intro to JavaScript Objects Setup
Open your Terminal application and navigate to your ~/code/ga/lectures directory:
cd ~/code/ga/lectures
Make a new directory called intro-to-javascript-objects, then enter this directory:
mkdir intro-to-javascript-objects
cd intro-to-javascript-objects
Then, create an app.js and an index.html file. These files will hold your work for this lecture:
touch index.html app.js
With the files created, open the contents of the directory in VS Code:
code .
Open the index.html file and add HTML boilerplate by typing ! and then hitting the Tab key. Then link the app.js file by adding this line inside the <head> tag:
<script defer src="./app.js"></script>
With this setup complete, we’ll have two methods at our disposal for executing the code we write in app.js:
-
Open the
index.htmlfile in your browser and access the console output in your browser’s dev tools. -
Use node to execute the
app.jsfile directly by using this command in your terminal:node app.js
While either method is acceptable, you should use the same method as your instructor for simplicity.