A

Admin • 833K Points
Coach

Q. What will be the result?

Code:
const obj = {name: 'John'};
delete obj.name;
console.log(obj.name);
  • (A) undefined
  • (B) John
  • (C) null
  • (D) Error
  • Correct Answer - Option(A)
  • Views: 14
  • Filed under category JavaScript
  • Hashtags:

Explanation by: Admin

The delete operator removes the property from the object.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.