What About The Hello-World Program in JavaSript?
JavaScript program is executed by a web browser; we don’t need to install any other software for running environment beforehand. Therefore, it is easy for beginners to learn how to run a JavaScript program.
Example 20:
(1) Open a Notepad, and write the following code to the editor.
<script>
var message = "Hello World!";
document.write(message);
</script>
|
(2) Save the above file as “myFile.html”, because we will run the program with a browser, save it as an html file.