It is a tradition when learning programming languages to start with a "Hello world!" program. This is a simple program that outputs the phrase "Hello world!" to announce your arrival to the world of programming. We’re going to stick to this tradition and write a "Hello world" program in JavaScript.
Go to JS Console in your browser and enter the following line of code:
console.log("Hello World!");
If all went to plan you should see a line in your console saying "Hello World!", similar to the screenshot in Figure 1.1.
Figure 1.1. "Hello world!" |
Congratulations, you’ve just written your first JavaScript program. It might not look like much, but remember that every ninja’s journey begins with a single step!
0 Response to "Your First JavaScript Program"
Post a Comment