- Home
- /
- JS Execution
JavaScript Tutorial
IINTRODUCTION
JAVASCRIPT VARIABLES
JAVASCRIPT BASICS
JAVASCRIPT OBJECTS
DOM & BOM
OOPs
- Home
- /
- JS Execution
JavaScript Execution
Now that we understand what JavaScript is, let’s talk about how it actually runs on your device.
Do We Need to Install JavaScript?
No, you don’t!
JavaScript is built into all modern web browsers like Chrome, Firefox, Edge, and Safari.
Whether you’re using a laptop, tablet, or smartphone — JavaScript is already there and ready to go.
How Can We Execute JavaScript?
There are three easy ways to run JavaScript code:
1. Inside the Browser (Console Method)
Most browsers have built-in developer tools.
You can write JavaScript directly in the console:
Open your browser (e.g., Chrome)
Press
F12
orCtrl+Shift+I
(Windows) orCmd+Option+I
(Mac)Go to the Console tab
Type JavaScript code and press Enter
It’s perfect for testing quick code snippets.
2. Using Node.js
If you want to run JavaScript outside the browser (e.g., on a server or in a terminal), use Node.js:
Download it from https://nodejs.org
Install it
Create a
.js
fileRun it using the terminal:
node yourfile.js
Node.js brings JavaScript to your local machine or server — beyond websites.
3. Inside HTML (Script Tag Method)
You can also run JavaScript directly in your HTML files.
Popular JS Frontend Frameworks:
React.js
Angular
Vue.js
Popular JS Backend Frameworks:
Node.js
Express.js
What Is JavaScript?
JavaScript is a versatile programming language used to create interactive web experiences. While HTML builds the structure and CSS handles design, JavaScript brings everything to life. It reacts to user actions—clicking buttons, submitting forms, showing animations, and much more.
It works on the client side (in the browser), but thanks to technologies like Node.js, it also powers the backend of many modern web applications.
Getting Started
To begin writing JavaScript:
Use a simple text editor like VS Code, Sublime Text, or Notepad++.
Save your code in a
.js
file.You can then link it to an HTML page or run it using the browser or Node.js.