javascript-questions
javascript-questions copied to clipboard
fix(q76): the answer and its explanation
In the original question the variable "name" was used and that (I guess) led to the result "undefined" (which is also incorrect). Actually the result would be an empty string. That is because the variable "name" isn't "undefined" it exists in the global scope as the "window.name" property. If we change the variable "name" to an arbitrary undefined variable then we will get the ReferenceError. The main idea of this question is to check whether the person knows object destructuring assignment.
@jakeherp I've provided the complete answer in this merge request because there was no updated answer or the answer could not be modified based on your explanation.
Closing in favour of #698, which was now merged