Table of contents
No headings in the article.
JavaScript is the world's most popular programming language. It is the programming language of the Web. Javascript is used by programmers across the world to create dynamic and interactive web content like applications and browsers.
Diving more into JavaScript, let's explore how to Run a JavaScript Code.
JavaScript can be run both inside and outside the browser environment. But let's discuss how we can run its code in the browser.
Here is the simplest code of JavaScript, wherein we have created a JavaScript code in an HTML file.
Save and open the file in the web browser and then open the browser's console by right-clicking on the blank web page and then selecting the Inspect option.
Click on the Console tab of the Developer Tools pane and you would see the output of your JavaScript code.
console.log( )
is a function in JavaScript that is used to print any kind of variables defined before in it or to just print any message that needs to be displayed to the user.
We can also create a separate javascript file with an extension .js
and link it with the main HTML file.
This is how we can run JavaScript Code. In the next blog, we will talk about variables, and how to declare variables in JavaScript.
If you liked this article, consider following me on Hashnode for my latest publications.