"Hello, World!" in JavaScript

#hello-world #javascript

Written by Anders Marzi Tornblad

How to do "Hello, World!" in JavaScript.

// hello-world.js
'use strict';
console.log('Hello, World!');

JavaScript has really matured over the last years. Though it started out as a browser-only language, giving grey hairs to web developers everywhere, it is now a competent language in its own right. Combined with initiatives such as node.js, it performs on par with most other system languages. The code above works in your browser (printing to the developer console) as well as in node.js (printing to your terminal output). And yes, you should always go for strict mode.

For more "Hello, World!" examples, go to the Hello World category.