JAVASCRIPT
The programming language of the web. While HTML provides structure and CSS provides style, JavaScript provides life. It turns static documents into interactive applications.
Client-Side Logic
JavaScript runs directly in the user's browser. This allows for instant feedback (like form validation) without needing to wait for a server response.
const btn = document.querySelector('.btn');
btn.addEventListener('click', () => {
alert('Hello World!');
});
btn.addEventListener('click', () => {
alert('Hello World!');
});
Core Capabilities
DOM Manipulation
Selecting HTML elements and changing their content or style dynamically.
Event Listeners
Responding to user actions like clicks, scrolls, and key presses.
Asynchronous JS
Handling API requests, Promises, and the Event Loop without freezing the UI.
Modern ES6+
Arrow functions, destructuring, modules, and classes.
script.js
async function getData() {
// 1. Start Request
const res = await fetch('/api/user');
// 2. Wait for Data...
const data = await res.json();
console.log(data);
}
Network Status
Waiting for execution...