-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First set of exercises for events & callbacks #3
Conversation
Readme with links to glossary entries on events and callbacks. Lists link to (currently empty) exercise on passing functions to functions.
Mosty focused on practice with the syntax of passing named & anonymous functions as arguments.
@zspencer tried to follow your lead as best I could with these exercises. There are fewer exercises than in your Letters and Words section, due to the difficulty that I presume students will have in reasoning about them. |
Short description of events with an example.
@@ -0,0 +1,44 @@ | |||
# Events and Callbacks | |||
|
|||
Working with JavaScript in the browser and in node.js requires an understanding of how events work. Then, to write _evented_ JavaScript, you need to be familiar with the notion of a _callback_ function. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra words. Why not just "Working with JavaScript requires an understanding..."
Overall, I think it's a pretty good first pass. I tried to create a few examples that are more "real worldy" for the earlier stuff. Feel free to take a second pass, or 👍 merge as is. It may be worth getting some real feedback from real people instead of over-thinking it. |
As per @zspencer's feedback, this keeps the focus on solving problems that deal with the topic at hand (passing and executing functions that take their own arguments).
Here is an example of an event listener that would run in the browser: | ||
|
||
```javascript | ||
var button = document.getElementById("#click-me"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getElementByID
doesn't need the #
sign.
Thanks for the feedback @zspencer. Much of it was integrated. Going ahead with the merge now. |
First set of exercises for events & callbacks
Includes basic outline for Events & Callbacks page and a set of exercises on Passing Functions to Functions.
Mostly focused on practice with the syntax of passing named & anonymous functions as arguments, so it is more of a mental exercise in building the notion of functions as objects than an exercise in learning new terms or methods.