Merge pull request #2753 from vigu86/patch-1
Remove redundant word in Possible Mistakes section
This commit is contained in:
commit
3c62eccbaf
1 changed files with 1 additions and 1 deletions
|
@ -160,7 +160,7 @@ 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:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue