Skip to content

mattdm3/wksp-module-2-js-2-fundamentals

Repository files navigation

JavaScript Fundamentals - Part 2

Setup

In order to easily evaluate your answers, you will need a node environment. We could use the browser, as I did during the lecture, but it would be easier to manage if there was a way to do this in VS Code. There is! 🤯

You can toggle the terminal window in VS Code with the following keyboard shortcut:

  • [ctrl + j] on Windows
  • [cmd + j] on Mac

This will open an instance of the terminal (Mac) or the PowerShell (Win).

There are 2 ways to evaluate your JS using Node:

Type JS directly into the Node Env.

  • Type node in the terminal, and hit enter.

This will turn that terminal into a Node environment for you to play with.

You can type JavaScript in the same way I did while using the Browser console.

Exit the Node Environment

To exit/quit Node and get back to the terminal, do [ctrl + c] twice.

Use Node to execute files

To run your exercise files, you will need to type the following command at the terminal/PowerShell prompt:

node <PATH TO FILE>

The easiest way to do this is to type node, hit [space] and then drag the file you want to evaluate into the terminal. This will place the path into the command line.

Alternatively, you can navigate to the right folder using cd and then you could type node <FILE_NAME>.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published