Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2da4d4b

Browse files
authored
return true on save method to continue chaining
The save method isn't returning this, so the car variable is equal to undefined instead of a Car object. BTW, Thanks alot for this guide.
1 parent ddd0181 commit 2da4d4b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1568,6 +1568,8 @@ class Car {
15681568

15691569
save() {
15701570
console.log(this.make, this.model, this.color);
1571+
// NOTE: Returning this for chaining
1572+
return this;
15711573
}
15721574
}
15731575

0 commit comments

Comments
 (0)