hello world in javacsript

hello world in javacsript

Here is a "Hello, World!" program in JavaScript:

console.log("Hello, World!");
‮S‬ource:www.lautturi.com

This code uses the console.log() function to print the string "Hello, World!" to the console.

To run this program, you can save the code in a file with a .js extension and run it using a JavaScript interpreter. For example, you can use the node command to run the program:

node hello.js

This will execute the console.log() function and print "Hello, World!" to the console.

You can also include the JavaScript code in an HTML file and run it in a web browser. For example, you can create an HTML file with the following content:

<html>
<body>
  <script>
    console.log("Hello, World!");
  </script>
</body>
</html>

You can then open the HTML file in a web browser, and the browser will execute the JavaScript code and print "Hello, World!" to the console.

For more information about writing and running JavaScript programs, you can refer to the JavaScript documentation (https://developer.mozilla.org/en-US/docs/Web/JavaScript).

Created Time:2017-11-01 12:05:07  Author:lautturi