You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 16, 2023. It is now read-only.
Can you go into further detail on why? Syntactically it makes sense that displayMatches is a function when including parentheses() and variables or constants can be quickly seen as such because they wont have parentheses()
@ahtee JavaScript has first-class functions, meaning that functions can be assigned to variables or passed as parameters the same as any other object or value. In this case, what we want to do is set the displayMatches function itself (not the return value from calling it) to be the button's onclick handler. The button will call displayMatches later, when it's clicked.
I don't think the step text should go into all that detail (unless it turns out to be a common point of confusion), but I updated the wording a bit to hopefully clarify what's going on.
In our example, we want to trigger a function when a button is clicked. To do this, we first need to get a reference to the button. We can use the querySelector method of the browser-provided document global variable to get that reference. Then we can set our displayMatches function to be the button's onclick handler.
https://github.com/Microsoft/frontend-bootcamp/blob/master/step1-03/demo/README.md
It's wrong to add brackets after displayMatches.
The text was updated successfully, but these errors were encountered: