@@ -445,7 +445,7 @@ function writeForumComment(subject, body) {
445445
446446** Good** :
447447``` javascript
448- function writeForumComment (subject = ' No subject' , body = ' No text' ) {
448+ function writeForumComment (subject = ' No subject' , body = ' No text' ) {
449449 ...
450450}
451451
@@ -790,7 +790,7 @@ The first thing to consider is consistent APIs.
790790** Bad:**
791791``` javascript
792792function travelToTexas (vehicle ) {
793- if (obj instanceof Bicylce ) {
793+ if (obj instanceof Bicycle ) {
794794 vehicle .peddle (this .currentLocation , new Location (' texas' ));
795795 } else if (obj instanceof Car) {
796796 vehicle .drive (this .currentLocation , new Location (' texas' ));
@@ -897,7 +897,7 @@ inventoryTracker('apples', req, 'www.inventory-awesome.io');
897897### Use getters and setters
898898JavaScript doesn't have interfaces or types so it is very hard to enforce this
899899pattern, because we don't have keywords like ` public ` and ` private ` . As it is,
900- using getters and setters to access data on objects if far better than simply
900+ using getters and setters to access data on objects is far better than simply
901901looking for a property on an object. "Why?" you might ask. Well, here's an
902902unorganized list of reasons why:
903903
@@ -1558,7 +1558,7 @@ you should prefer composition over inheritance where you can. There are lots of
15581558good reasons to use inheritance and lots of good reasons to use composition.
15591559The main point for this maxim is that if your mind instinctively goes for
15601560inheritance, try to think if composition could model your problem better. In some
1561- cases it can. Inheritance is great for preventing
1561+ cases it can.
15621562
15631563You might be wondering then, "when should I use inheritance?" It
15641564depends on your problem at hand, but this is a decent list of when inheritance
0 commit comments