It is programming tradition that the first thing you do in any language is make it output 'Hello world!'.
We'll do this in JavaScript, using something called console.log().
Inside of exercise.js there's a line of code that will print "Hello world!".
- Open a terminal window
- Change directory to this folder (
cd B-hello-world) - Run the program using node (
node exercise.js)
- Try to
console.log()something different. For example, 'Hello World. I just started learning JavaScript!'. - Try to console.log() several things at once.
- What happens when you get rid of the quote marks?
- What happens when you console.log() just a number without quotes?