Welcome to another tutorial. In this tutorial, you will be introduced to different ways to run JavaScript on your computer.
As you may know, JavaScript is a popular programming language that has a broad range of applications.
In the earlier stage of the use of JavaScript, it was mostly used to enhance webpages' interactivity in areas such as animation form validation, etc. However, JavaScript is more than that, it’s now widely used in areas such as mobile application development server-side development, etc.
The uniqueness of JavaScript makes it possible to be run in several ways, such as;
JavaScript can run on all popular web browsers because most browsers have built-in JavaScript.
This is how to run JavaScript on your browser
3. For other browsers: On the developer tools, go to the console tab. Then, you write the JS code and press enter to run the code.
Node is a back-end run-time environment used in executing JavaScript code. To Node.js to run JavaScript, follow the steps below:
create a file → write JS code →save it with a .js extension.
Note: you can run JavaScript on the command prompt/terminal directly.in other to do that, type node and press enter. Thereafter, you can start writing JS code.
From the above, we understood that JavaScript was created to make web pages interactive, as such JavaScript and HTML are interconnected and therefore go hand in hand.
Just like this:
One more thing, in the HTML file, we need to link the main.js file in other to use it. To do this, add the following code in main.html.
I believe you can now run JavaScript on your own. In the next lesson, you will be introduced to the fundamentals of JavaScript.