Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit dba5de9

Browse files
Merge pull request #825 from GuyKh/patch-1
Update Type Inference - mouseEvent.button is valid and not a bad example
2 parents de12242 + 04a41c7 commit dba5de9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pages/Type Inference.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ This is known as "contextual typing". Contextual typing occurs when the type of
5050

5151
```ts
5252
window.onmousedown = function(mouseEvent) {
53-
console.log(mouseEvent.button); //<- Error
53+
console.log(mouseEvent.clickTime); //<- Error
5454
};
5555
```
5656

@@ -63,7 +63,7 @@ Had we written the above example:
6363

6464
```ts
6565
window.onmousedown = function(mouseEvent: any) {
66-
console.log(mouseEvent.button); //<- Now, no error is given
66+
console.log(mouseEvent.clickTime); //<- Now, no error is given
6767
};
6868
```
6969

0 commit comments

Comments
 (0)