TGViewer
Web Development - HTML, CSS & JavaScript Web Development - HTML, CSS & JavaScript @javascript_courses · 55.7K subscribers
Post #3125 10.1K
✅ JavaScript Objects – Interview Questions & Answers ⚡🧠

🔹 1. What is an object in JavaScript?
An object is a collection of key-value pairs used to store related data and functionality.
Example:
const user = { name: "Alice", age: 25 };


🔹 2. How do you access object properties?
Using dot or bracket notation:
user.name  // "Alice"  
user["age"] // 25


🔹 3. How can you loop through an object?
Use for...in or Object.keys()/Object.entries():
for (let key in user) { console.log(key, user[key]); }


🔹 4. Difference between Object.freeze() and Object.seal()?
⦁ freeze() prevents any change (no adding, deleting, or modifying properties).
⦁ seal() allows value changes, but not adding/removing keys.

🔹 5. How do you clone an object?
const clone = {...user };  
// or
const copy = Object.assign({}, user);


🔹 6. What is this inside an object?
this refers to the object itself in method context.
const person = {
name: "Bob",
greet() { return `Hi, I’m ${this.name}`; }
};


🔹 7. How do prototypes relate to objects?
Every JS object has a hidden [[Prototype]]. It lets objects inherit properties from others.

🔹 8. What is a constructor function?
A function used to create multiple similar objects:
function User(name) {
this.name = name;
}
const u = new User("Tom");


🔹 9. What's the difference between Object.create() and new keyword?
⦁ Object.create(proto) creates an object with the given prototype.
⦁ new invokes a constructor function to initialize objects.

🔹 10. How do you check if a property exists in an object?
"name" in user // true
user.hasOwnProperty("age") // true

💬 Tap ❤️ for more!
  • ❤ 36
  • 🔥 1
  • 👏 1
More from @javascript_courses
  1. Oct 9, 2026🇮🇳 𝗚𝗢𝗩𝗘𝗥𝗡𝗠𝗘𝗡𝗧 𝗢𝗙 𝗜𝗡𝗗𝗜𝗔 — 𝗔𝗜𝗖𝗧𝗘 𝗜𝗡𝗧𝗘𝗥𝗡𝗦𝗛𝗜𝗣𝗦 𝟮𝟬𝟮𝟲 🚀…
  2. Oct 8, 2026🎓 𝗠𝗶𝗰𝗿𝗼𝘀𝗼𝗳𝘁 𝗙𝗥𝗘𝗘 𝗖𝗼𝘂𝗿𝘀𝗲𝘀 𝘄𝗶𝘁𝗵 𝗖𝗲𝗿𝘁𝗶𝗳𝗶𝗰𝗮𝘁𝗲𝘀! 🚀🔥 Upgr…
  3. Oct 7, 2026🚀𝗣𝗮𝘆 𝗔𝗳𝘁𝗲𝗿 𝗣𝗹𝗮𝗰𝗲𝗺𝗲𝗻𝘁 𝗧𝗿𝗮𝗶𝗻𝗶𝗻𝗴 | 𝗕𝗲𝗰𝗼𝗺𝗲 𝗮 𝗙𝘂𝗹𝗹𝘀𝘁𝗮𝗰…
  4. Oct 7, 2026𝗠𝗮𝘀𝘁𝗲𝗿 𝗣𝗼𝘄𝗲𝗿 𝗕𝗜 𝗳𝗼𝗿 𝗙𝗥𝗘𝗘! 🔥 Learn Power BI through these FREE learnin…
  5. Oct 4, 2026DSA Handwritten Notes
  6. Sep 28, 2026To learn web design and development from basic to advanced levels, you can follow these st…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →