Remove redundant word in Possible Mistakes section
This commit is contained in:
parent
eda333d423
commit
db074cd4c6
1 changed files with 1 additions and 1 deletions
|
@ -160,7 +160,7 @@ button.onclick = sayThanks;
|
||||||
button.onclick = sayThanks();
|
button.onclick = sayThanks();
|
||||||
```
|
```
|
||||||
|
|
||||||
If we add parentheses, then `sayThanks()` becomes is a function call. So the last line actually takes the *result* of the function execution, that is `undefined` (as the function returns nothing), and assigns it to `onclick`. That doesn't work.
|
If we add parentheses, then `sayThanks()` becomes a function call. So the last line actually takes the *result* of the function execution, that is `undefined` (as the function returns nothing), and assigns it to `onclick`. That doesn't work.
|
||||||
|
|
||||||
...On the other hand, in the markup we do need the parentheses:
|
...On the other hand, in the markup we do need the parentheses:
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue