Here are the major features introduced in ES6 (ECMAScript 2015) Variables and Scope let and const – Block-scoped variable declarations replacing var Block scoping – Variables scoped to blocks instead of just functions Functions Arrow functions – Shorter syntax with lexical this binding: (x) => x * 2 Default parameters – function greet(name = “Guest”) […]
Inheritance Explanation Prototype-Based Inheritance JavaScript uses prototypes rather than classical inheritance. Every object has an internal link to another object called its prototype. When you try to access a property on an object, JavaScript first looks at the object itself, then checks its prototype, then the prototype’s prototype, and so on up the chain. Code […]
Arrow & Normal(Annonymous) function Explanation Let me explain the differences between arrow functions and normal (regular) functions with practical examples. const person = { name: “Alice”, age: 25, // Normal function – ‘this’ refers to the person object greetNormal: function() { console.log(`Hi, I’m ${this.name}`); }, // Arrow function – ‘this’ refers to parent scope (window/global) […]
Deep & Shallow Copy Explanation In JavaScript, objects and arrays are stored by reference, not by value. So when you “copy” them the wrong way, you don’t get a new object — you get two variables pointing to the same memory That’s where shallow vs deep copy comes in. Interviewer also asks Mutable & Immutable […]
Apply() explanation Let’s explain apply() in JavaScript the right way — starting from the real problem, why it happens, and how Apply() solves it. This approach is best for interviews and real-world understanding. var employee = { name: ‘Biswajit Jana’, org: ‘Capgemini’, displayInfo: function() { console.log(‘Employee: ‘+ this.name + ‘ works at ‘+ this.org); } […]
Call() & Bind() explanation Let’s explain call() in JavaScript the right way — starting from the real problem, why it happens, and how call() & Bind() solves it. This approach is best for interviews and real-world understanding. var employee = { name: ‘Biswajit Jana’, org: ‘Capgemini’, displayInfo: function() { console.log(‘Employee: ‘+ this.name + ‘ works […]