Category: Javascript
-
important ES6 interview questions
🔰 Basic ES6 Interview Questions 1. What is ES6? 👉 ES6 (ECMAScript 2015) is the 6th version of JavaScript with modern features like let, const, arrow functions, etc. 2. Difference between var, let, and const? Feature var let const Scope Function Block Block Reassign ✅ ✅ ❌ Hoisting Yes Yes (TDZ) Yes (TDZ) 3. What…
-
ES6 full form
👉 ECMAScript 2015 ECMAScript full form: 👉 European Computer Manufacturers Association Script Explanation: 👉 ECMAScript is the standard on which JavaScript is based. Simple Line: 👉 ECMAScript = Standard version of JavaScript defined by ECMA organization Explanation: Simple Line: 👉 ES6 = ECMAScript 6 (ECMAScript 2015)
-
1️⃣2️⃣ ES6 Modern JavaScript
1️⃣ let & const 🔹 let 🔹 const 2️⃣ Arrow Functions (=>) Shorter way to write functions. Normal Function Arrow Function With one parameter 3️⃣ Template Literals ( ) Use backticks instead of quotes → allows variables & multi-line strings. Multi-line let text = `Line 1Line 2Line 3`; 4️⃣ Destructuring Extract values from arrays/objects easily.…
-
1️⃣1️⃣ Working With APIs
1️⃣ What is an API? API = Application Programming Interface 👉 It allows two applications to communicate with each other. Example: 👉 Like a waiter: 2️⃣ Fetch API fetch() is used to get data from APIs Basic Syntax: Modern (Async/Await): 3️⃣ JSON (JavaScript Object Notation) 👉 Most APIs return data in JSON format Example JSON:…
-
20 important interview questions on Asynchronous JavaScript
🔥 Async JavaScript – Interview Questions 🟢 Basic Level (1–7) 1. What is Asynchronous JavaScript? 👉 JavaScript that allows tasks to run in the background without blocking the main thread. 2. Difference between synchronous and asynchronous? 3. What is setTimeout()? 👉 Runs a function once after a specified delay. 4. What is setInterval()? 👉 Runs…
-
🔟 Asynchronous JavaScript
1. Synchronous vs Asynchronous ✅ Synchronous (Blocking) Code runs line by line, one after another. 👉 Output: StartMiddleEnd Everything waits for the previous line to finish. ⚡ Asynchronous (Non-blocking) Some tasks take time (API calls, timers). JS sends them to the background and continues execution. 👉 Output: StartEndMiddle 👉 JS doesn’t wait for setTimeout. 2.…
-
real-style JavaScript questions asked by companies like Google, Amazon, Microsoft
Real Company-Level JavaScript Questions 1️⃣ (Amazon) – Closure + Loop Trap ❓ Output: 5 5 5 5 5 💡 Why? var is function-scoped → same i shared ✅ Fix: 2️⃣ (Google) – Event Loop Priority ❓ Output: ADCB 💡 Why? Microtasks (Promise) run before macrotasks (setTimeout) 3️⃣ (Amazon) – this Binding ❓ Output: undefined 💡…
-
Tricky JS Output Questions
1️⃣ Hoisting + var Output: undefined Why?var a is hoisted → initialized with undefined 2️⃣ Hoisting + let Output: ReferenceError Why?let is in Temporal Dead Zone 3️⃣ Function vs Variable Hoisting Output: 10 Why?Function is hoisted first, but var a = 10 overrides it 4️⃣ Closure Trick Output: 11 Why?Closure remembers a 5️⃣ setTimeout +…
-
Advanced JavaScript Interview Q&A
1️⃣ What is Scope in JavaScript? Answer:Scope determines where variables are accessible. 👉 b is not accessible outside the function. 2️⃣ What is Hoisting? Answer:Hoisting is JavaScript’s default behavior of moving declarations to the top. 👉 var is hoisted with undefined ⚠️ let and const are hoisted but in Temporal Dead Zone 3️⃣ What is…
-
9️⃣ Advanced JavaScript
1️⃣ Scope Scope defines where variables are accessible in your code. Types: 👉 c is NOT accessible outside block. 2️⃣ Hoisting Hoisting means variables and functions are moved to the top of their scope during execution. Internally becomes: ⚠️ Important: 3️⃣ Closures Closure = function + its lexical environment A function remembers variables from its…
