Skip to content

Commit

Permalink
Merge pull request #2205 from pauly48/master
Browse files Browse the repository at this point in the history
JS2 Part 3 syntax error corrected
  • Loading branch information
flacial authored Aug 19, 2022
2 parents 08424af + 0bb9a79 commit 06cb15d
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1406,7 +1406,8 @@ When the function is running, `this` refers to the object that comes before `.`.
```jsx
Array.prototype.last = function () {
return this[this.length - 1]
}[(1, 2, 3)].last() // When the last function is run, 'this' refers to [1,2,3]
};
[1, 2, 3].last() // When the last function is run, 'this' refers to [1,2,3]
const jackfruit = [1, 2, 3].last() // What is jackfruit?
```
Expand All @@ -1415,7 +1416,8 @@ const jackfruit = [1, 2, 3].last() // What is jackfruit?
```jsx
Array.prototype.last = function () {
return this[this.length - 1]
}[(1, 2, 3)].last() // When the last function is run, this refers to [1,2,3]
};
[1, 2, 3].last() // When the last function is run, this refers to [1,2,3]
jackfruit = [1, 2, 3].last() // 3
```
Expand Down

1 comment on commit 06cb15d

@vercel
Copy link

@vercel vercel bot commented on 06cb15d Aug 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.