Question 4
Back to Exercise
What does delete user.middleName return when user has no such property?
- A true – deleting a property that does not exist still succeeds Correct
- B false
- C undefined
- D It throws a ReferenceError
Correct Answer: Option A
delete returns false only when a property exists but cannot be deleted (non-configurable, in sloppy mode). In strict mode that case throws instead.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!