Your First Program
Learn and practice your first JavaScript program.
Here’s our very first JavaScript program.
console.log("Hello from JavaScript!");
This program displays the text "Hello from JavaScript!"
in the console, a zone displaying textual information available in most JavaScript environments, such as browsers.
To achieve this, it uses a JavaScript command named console.log()
, whose role is to display a piece of information. The text to be displayed is placed between parentheses and followed by a semicolon, which marks the end of the line.
Displaying a text on the screen (the famous Hello World all programmers know) is often the first thing you’ll do when you learn a new programming language. It’s the classic example. You’ve already taken that first step!