Remove redundant word in Possible Mistakes section

This commit is contained in:
Vigu 2021-10-22 06:40:40 +02:00 committed by GitHub
parent eda333d423
commit db074cd4c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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: