File tree
Expand file treeCollapse file tree1 file changed
+2
-2
lines changed Expand file treeCollapse file tree1 file changed
+2
-2
lines changed Original file line number | Diff line number | Diff line change |
---|
@@ -789,9 +789,9 @@ The first thing to consider is consistent APIs.
|
789 | 789 | **Bad:**
|
790 | 790 | ```javascript
|
791 | 791 | function travelToTexas(vehicle) {
|
792 |
| -if (obj instanceof Bicycle) { |
| 792 | +if (vehicle instanceof Bicycle) { |
793 | 793 | vehicle.peddle(this.currentLocation, new Location('texas'));
|
794 |
| -} else if (obj instanceof Car) { |
| 794 | +} else if (vehicle instanceof Car) { |
795 | 795 | vehicle.drive(this.currentLocation, new Location('texas'));
|
796 | 796 | }
|
797 | 797 | }
|
|
You can’t perform that action at this time.
0 commit comments