Skip to content

Commit

Permalink
fixed example
Browse files Browse the repository at this point in the history
  • Loading branch information
xat authored Jan 19, 2017
1 parent 1bab935 commit 5e05e52
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions _posts/en/2017-01-19-binding-objects-to-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,19 @@ A copy of the given function along with the specified `this` value and initial a
```js
const myCar = {
brand: 'Ford',
type: 'Sedan'
Color:Red
type: 'Sedan',
color: 'Red'
};

const getBrand = () => {
const getBrand = function() {
console.log(this.brand);
};

const getType = () => {
const getType = function() {
console.log(this.type);
};

const getColor = () => {
const getColor = function() {
console.log(this.color);
};

Expand All @@ -60,6 +60,6 @@ getBrand(myCar); // object not bind,undefined

getType.bind(myCar)(); // Sedan

getColor.bind(myCar); // Red
getColor.bind(myCar)(); // Red

```
```

0 comments on commit 5e05e52

Please sign in to comment.