javascript-questions icon indicating copy to clipboard operation
javascript-questions copied to clipboard

fix(q76): the answer and its explanation

Open ArturAbdullin opened this issue 2 years ago • 1 comments

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.

ArturAbdullin avatar Oct 10 '22 17:10 ArturAbdullin

@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.

SeyyedKhandon avatar Dec 07 '22 15:12 SeyyedKhandon

Closing in favour of #698, which was now merged

jakeherp avatar Jan 22 '23 17:01 jakeherp