Writing JavaScript

Here’s a demo of writing and running some JavaScript code. The example code from the video is attached here.

If the embed above does not work here is a link to the full version of the video

We can use node to run files containing JavaScript code on the command line.

So, for example, a basic helloworld.js containing:

console.log("hello world!");

can be run like so:

ls helloworld.js node helloworld.js hello world!

Next: Using functions

Previous: Iteration