Up until now, you have executed JavaScript entirely within a web browser, being read from a locally saved index.html
file.
For the next few days of drills, you will create standalone JavaScript files and execute it from the command line.
-
Application logic and managing the view layer (i.e. in web development, the browser's DOM) are very distinct concerns
-
By enforcing you execute logic outside of the browser, this encourages you to think like a developer and be mindful to separate your concerns
-
Help increase your comfort with the command line
-
When starting a new day, create a new project folder on your machine and initialize the git repo.
-
Create a new JavaScript file with a related name for the exercise, e.g.
jedi-drill.js
-
Execute the file from the command line by typing:
$ node jedi-drill.js
-> "My Jedi name is GreRi Londo"
In the shell environment, the only output available to you will be via console
methods, most commonly console.log()
.