DEV Community

Discussion on: JavaScript Interview Question #15: Getter function

Collapse
 
thi3rry profile image
Thierry Poinot • Edited

Is "this" in the arrow function doesn't return the id prop of the global scope ?
If you define an id prop on window, your arrow getter would return the window.id value no ?

Collapse
 
coderslang profile image
Coderslang: Become a Software Engineer

Yes, it absolutely would.

window-id