This commit is contained in:
Ilya Kantor 2016-11-12 19:38:58 +03:00
parent 5372c18379
commit 3defacc09d
314 changed files with 1761 additions and 1704 deletions

View file

@ -1,23 +0,0 @@
importance: 5
---
# Using "this" in object literal
Here the function `makeUser` returns an object.
What is the result of accessing its `ref`? Why?
```js
function makeUser() {
return {
name: "John",
ref: this
};
};
let user = makeUser();
alert( user.ref.name ); // What's the result?
```