Intro to JavaScript Functions Lab Setup

Setup

Open your Terminal application and navigate to your ~/code/ga/labs directory:

cd ~/code/ga/labs

Navigate to GitHub and create a new repository named intro-to-javascript-functions-lab.

Using the Quick Setup option, clone your newly created repo into your ~/code/ga/labs directory with the git clone command:

git clone https://github.com/<your-username>/intro-to-javascript-functions-lab.git

Note: In the link above, where it says <your-username>, you should see the username from your GitHub account.

Next, cd into your new cloned directory, intro-to-javascript-functions-lab:

cd intro-to-javascript-functions-lab

Then, create an app.js and an index.html file. These files will hold your work for this lab:

touch app.js index.html

With the files created, open the contents of the directory in VS Code:

code .

Open the index.html file and add HTML boilerplate. 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:

node app.js

While either method is acceptable, you should use the same method as your instructor for simplicity.