Skip to content

Commit 5fc8475

Browse files
authored
contents: fix typo in how this works (#28)
1 parent 23d0816 commit 5fc8475

File tree

1 file changed

+1
-1
lines changed
  • questions/explain-how-this-works-in-javascript

1 file changed

+1
-1
lines changed

questions/explain-how-this-works-in-javascript/en-US.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ title: Explain how `this` works in JavaScript
66

77
There's no simple explanation for `this`; it is one of the most confusing concepts in JavaScript because it's behavior differs from many other programming languages. The one-liner explanation of the `this` keyword is that it is a dynamic reference to the context in which a function is executed.
88

9-
A longer explanation follows is that `this` follows these rules:
9+
A longer explanation is that `this` follows these rules:
1010

1111
1. If the `new` keyword is used when calling the function, meaning the function was used as a function constructor, the `this` inside the function is the newly-created object instance.
1212
2. If `this` is used in a `class` `constructor`, the `this` inside the `constructor` is the newly-created object instance.

0 commit comments

Comments
 (0)