Search⌘ K
AI Features

How to Run Modern JavaScript

Explore how to execute modern JavaScript code efficiently across different environments. Learn to use Node.js for running scripts and REPL for quick experiments. Understand how browser consoles aid in development and how Babel transpiles code to support various browser versions, ensuring compatibility and ease of testing.

JavaScript has evolved considerably, but the runtime engines are still catching up. Different browsers have varied support for the newer versions of JavaScript’s different features.

Here are a few options for running JavaScript in general and, in particular, to practice.

Run in Node.js

The easiest way to practice the code is in Node.js. Versions 8.5 and later support most of the latest features. This course will guide you along where necessary if you need to use a command-line experimental option or an additional tool.

Installing Node.js

First, verify that Node.js is installed on your system. Point your browser to https://nodejs.org and download the latest version if you don’t have it or if you have a fairly old version. To avoid colliding with versions of Node.js ...