File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
1-js/04-object-basics/06-constructor-new Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff 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
157157And 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
167167alert ( new SmallUser ().name ); // John
You can’t perform that action at this time.
0 commit comments