Skip to content

Commit 20a8c6c

Browse files
Merge pull request ryanmcdermott#3 from mariotacke/fix-spelling-errors
(docs) Correct spelling errors and remove unfinished sentence.
2 parents bc1ae6a + a3e6e97 commit 20a8c6c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -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
792792
function 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
898898
JavaScript doesn't have interfaces or types so it is very hard to enforce this
899899
pattern, 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
901901
looking for a property on an object. "Why?" you might ask. Well, here's an
902902
unorganized list of reasons why:
903903

@@ -1558,7 +1558,7 @@ you should prefer composition over inheritance where you can. There are lots of
15581558
good reasons to use inheritance and lots of good reasons to use composition.
15591559
The main point for this maxim is that if your mind instinctively goes for
15601560
inheritance, 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

15631563
You might be wondering then, "when should I use inheritance?" It
15641564
depends on your problem at hand, but this is a decent list of when inheritance

0 commit comments

Comments
 (0)