Category: Javascript
-
associativity and precedence in javascript
In JavaScript, operator precedence and associativity determine how expressions are evaluated when multiple operators are used together. 🔷 1. Operator Precedence (Priority) Precedence defines which operator is executed first in an expression. 👉 Higher precedence = executed first👉 Lower precedence = executed later Example: 👉 Here: 5 * 2 = 1010 + 10 = 20…
-
1️⃣7️⃣ Final Projects (Portfolio Level)
These Final Projects (Portfolio Level) are meant to show real-world skills—the kind companies actually look for. I’ll explain each one in a practical way so your students understand what to build + what they learn. 1️⃣ E-commerce Product Filter 🛒 📌 What it is: A shopping page where users can filter products by: ⚙️ Features:…
-
1️⃣6️⃣ Mini Projects (Important for Students)
These mini projects are perfect for students because they combine real-world logic + JavaScript practice. I’ll explain each one in a simple way so you understand what to build + what concepts you’ll learn. 1️⃣ Calculator What it is:A simple calculator that performs +, −, ×, ÷ Features: What students learn: 2️⃣ Digital Clock What…
-
JavaScript OOP MCQ Test
🧠 JavaScript OOP MCQ Test (25 Questions) 🟢 Basic Level 1. What is OOP? A. Programming with loopsB. Programming with objectsC. Programming with HTMLD. None👉 Answer: B 2. Which keyword is used to create a class? A. functionB. objectC. classD. define👉 Answer: C 3. What is an object? A. FunctionB. Instance of classC. LoopD. Variable👉…
-
JavaScript OOP Interview Questions from basic to advanced
🟢 Basic Level Questions 1. What is OOP in JavaScript? 👉 A programming paradigm based on objects and classes to structure code. 2. What is a class in JavaScript? 👉 A blueprint to create objects using properties and methods. 3. What is an object? 👉 An instance of a class that contains data (properties) and…
-
1️⃣5️⃣ JavaScript OOP
1️⃣ JavaScript OOP (Overview) OOP is a way of writing code using objects and classes to organize and reuse logic. Instead of writing everything in functions, we create blueprints (classes) and objects (instances). 2️⃣ Classes A class is a blueprint to create objects. Example: 👉 Person is a class👉 p1 is an object (instance) 3️⃣…
-
30 practice questions on error handling
🚀 JavaScript Error Handling – 30 Practice Questions 🔹 Beginner Level (1–10) 1. Write a program that divides two numbers using try…catch and handles division by zero. 2. Create a try…catch block to handle an undefined variable error. 3. Write code that parses invalid JSON and catches the error. 4. Use finally to print “Execution…
-
1️⃣4️⃣ JavaScript Error Handling
JavaScript Error Handling helps you manage runtime errors so your program doesn’t crash unexpectedly. Let’s break down each keyword clearly: 🔹 1. try The try block contains code that might cause an error. 👉 JavaScript will attempt to run this code. 🔹 2. catch The catch block runs if an error occurs in try. 👉…
-
1️⃣3️⃣ Local Storage (Browser Storage)
Local Storage allows you to save data in the user’s browser so it persists even after page refresh or closing the browser. There are two types: 🔹 1. localStorage ✅ Syntax: 📌 Example: 🔹 2. sessionStorage ✅ Syntax: 📌 Example: 🔥 Key Difference Feature localStorage sessionStorage Lifetime Permanent Tab session only Storage Limit ~5MB ~5MB…
