Skip to content

Commit 2d3f7cc

Browse files
committed
minor
1 parent 5c8d24a commit 2d3f7cc

File tree

1 file changed

+3
-3
lines changed
  • 1-js/04-object-basics/06-constructor-new

1 file changed

+3
-3
lines changed

1-js/04-object-basics/06-constructor-new/article.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,10 @@ function BigUser() {
148148

149149
this.name = "John";
150150

151-
return { name: "Godzilla" }; // <-- returns an object
151+
return { name: "Godzilla" }; // <-- returns this object
152152
}
153153

154-
alert( new BigUser().name ); // Godzilla, got that object ^^
154+
alert( new BigUser().name ); // Godzilla, got that object
155155
```
156156

157157
And here's an example with an empty `return` (or we could place a primitive after it, doesn't matter):
@@ -161,7 +161,7 @@ function SmallUser() {
161161

162162
this.name = "John";
163163

164-
return; // finishes the execution, returns this
164+
return; // <-- returns this
165165
}
166166

167167
alert( new SmallUser().name ); // John

0 commit comments

Comments
 (0)