DEV Community

loading...

Discussion on: Mini Quiz: Javascript Scoping

Collapse
lexlohr profile image
Alex Lohr • Edited

Depends on whether you 1) fix the code (you're missing a comma after the height and a closing } at the end) and 2) don't have "use strict" before the code (in which case this is set to undefined until explicitly set by call/apply or in prototypal methods); then the first console.log will show the person and the second one window/global (depending on your JS runtime).

Collapse
sheldonnunes profile image
Sheldon Nunes Author • Edited

Well spotted on the code error. Was not intentional and have since updated it :P