JavaScript BOM
JavaScript BOM (Browser Object Model) The Browser Object Model (BOM) allows JavaScript to interact with the browser itself, not just the webpage. Through BOM, JavaScript can: Control browser windows Access browser history Work with...
JavaScript BOM (Browser Object Model) The Browser Object Model (BOM) allows JavaScript to interact with the browser itself, not just the webpage. Through BOM, JavaScript can: Control browser windows Access browser history Work with...
JavaScript DOM (Document Object Model) The DOM is a programming interface that allows JavaScript to interact with and manipulate web pages. When a web page loads, the browser converts the HTML into a tree...
JavaScript Strict Mode Strict Mode is a feature in JavaScript that helps you write cleaner, safer, and error-free code by enforcing stricter rules. To enable strict mode, add the line: “use strict”; at the...
JavaScript Hoisting In JavaScript Hoisting default behavior of moving variable and function declarations to the top of their scope before execution. This means you can use variables and functions before declaring them (but with...
JavaScript Scope (Beginner → Advanced) Scope in JavaScript defines where a variable can be accessed in your code.Understanding scope is critical for writing bug-free JS, especially with var, let, const, functions, and closures. What...
JavaScript Events JavaScript events are actions or occurrences that happen in the browser. JavaScript can respond to these events and make the webpage interactive. Examples of events: Clicking a button Typing in a text...
JavaScript Errors In JavaScript Errors when something goes wrong while the program runs. They help you detect bugs and fix them. JavaScript errors fall into two main categories: Syntax Errors These happen when the...
JavaScript RegExp In JavaScript RegExp is a pattern used to search, match, and manipulate text. It helps validate data like email, phone numbers, passwords, etc. You can create a RegExp in two ways:
1 2 | let pattern = /hello/; // Literal notation let pattern2 = new RegExp("hello"); // Using constructor |
...
JavaScript Math In JavaScript Math provides a built-in Math object to perform mathematical operations.It is not a constructor — you use it directly: Math.method(). Basic Math Methods Math.round() Rounds to the nearest integer.
1 2 | Math.round(4.6); // 5 Math.round(4.4); // 4 |
...
JavaScript Maps In JavaScript Maps is a collection of key-value pairs in JavaScript. Unlike objects, Maps allow: Any type of key (objects, functions, numbers, strings) Values to be stored in insertion order Easy size...