Course
Hello World
JavaScript Tutorial
This JavaScript tutorial is crafted for beginners to introduce them to the basics and advanced concepts of JavaScript. By the end of this guide, you'll reach a proficiency level that sets the stage for further growth. Aimed at empowering you to progress towards becoming a world-class software developer, this tutorial paves the way for a successful career in web development and beyond.
Hello World Program
Write "Hello World" Program in JavaScript
In this lesson, we will learn how to write a simple "Hello World" program in JavaScript. This program is often the first program beginners write when learning a new programming language.
Using console.log()
The console.log() is a very convenient method to print the message to web Console. It is very useful to debug the JavaScript codes in the browsers. Let's look at the simple application of the
console.log()
to print the "Hello World" to the web console.Example
Let's try to write a complete JavaScript program with HTML.
<html><head> <script> console.log("Hello World"); </script></head><body> <p> Please open the console before clicking "Edit & Run" button </p></body><html>
It will produce the following message in the web console
Hello World
To open the web console in Google Chrome, follow these short instructions: Windows/Linux: PressCtrl + Shift + J
Mac: PressCmd + Option + J