This commit is contained in:
Ilya Kantor 2016-07-31 00:28:27 +03:00
parent 9064e35f3f
commit 4c531b5ae7
371 changed files with 338 additions and 316 deletions

View file

@ -0,0 +1,23 @@
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?
```