JavaScript | JavaScript Objects | Question 9

Last Updated :
Discuss
Comments

What will the following code log?

JavaScript
const obj = { a: 1, b: 2 };
delete obj.a;
console.log(obj)


{ b: 2 }

{ a: null, b: 2 }

{ a: undefined, b: 2 }

Error

Share your thoughts in the comments