Posts

What is Class in js

Image
  "In JavaScript, a class is an ES6 feature that makes it easier to create objects and use inheritance. Behind the scenes, it still works using prototypes and supports constructors, methods, and inheritance with extends and super ."

✅ Simple Comparison: Object vs Map in JavaScript

Image
 

What is JSON and its common operations?

Image
.✅ Interview One-liner: JSON (JavaScript Object Notation) is a text-based data format used for storing and transferring data. In JavaScript, we use JSON.stringify() to convert an object to JSON, and JSON.parse() to convert JSON back to an object

What is the Difference Between call, apply, and bind?

Image
  Interview One-liner: call and apply invoke the function immediately with a specific this value. The only difference is that call takes arguments one by one, and apply takes them as an array. bind returns a new function with this bound, which you can call later.

What is a prototype chain?

Image
  ✅ Simple Explanation of Prototype Chain in JavaScript: In JavaScript, every object has a hidden property called [[Prototype]] (accessible using __proto__ ), which points to another object . This forms a chain — called the prototype chain . 💡 Think of it like this: Imagine you're looking for a book in your room: First, you check your own shelf (the object itself). If not found, you ask your parents (the object's prototype). If they don’t have it, they ask your grandparents , and so on... 👉 This is how JavaScript looks for properties or methods — it goes up the prototype chain until it finds it or reaches the top ( null ).

What are the possible ways to create objects in JavaScript ?

Image
In JavaScript, there are multiple ways to create objects .