Fix typos (#47)

This commit is contained in:
Can Güney Aksakalli
2017-10-16 11:20:36 +02:00
committed by Yangshun Tay
parent f2bcca85a3
commit 7870a58b31
5 changed files with 7 additions and 7 deletions

View File

@@ -766,7 +766,7 @@ This question is pretty vague. My best guess at its intention is that it is aski
`var person = Person()` invokes the `Person` as a function, and not as a constructor. Invoking as such is a common mistake if it the function is intended to be used as a constructor. Typically, the constructor does not return anything, hence invoking the constructor like a normal function will return `undefined` and that gets assigned to the variable intended as the instance.
`var person = new Person()` creates an instance of the `Person` object using the `new` operator, which inherits from `Person.prototype`. An alterative would be to use `Object.create`, such as: `Object.create(Person.prototype)`.
`var person = new Person()` creates an instance of the `Person` object using the `new` operator, which inherits from `Person.prototype`. An alternative would be to use `Object.create`, such as: `Object.create(Person.prototype)`.
```js
function Person(name) {