Skip to content
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

Merged
merged 11 commits into from
Nov 7, 2014

Conversation

tannerwelsh
Copy link
Contributor

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.

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.
@tannerwelsh
Copy link
Contributor Author

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

@@ -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.
Copy link
Contributor

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..."

@zspencer
Copy link
Contributor

zspencer commented Nov 7, 2014

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.

Here is an example of an event listener that would run in the browser:

```javascript
var button = document.getElementById("#click-me");
Copy link
Contributor

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.

@tannerwelsh
Copy link
Contributor Author

Thanks for the feedback @zspencer. Much of it was integrated.

Going ahead with the merge now.

tannerwelsh added a commit that referenced this pull request Nov 7, 2014
First set of exercises for events & callbacks
@tannerwelsh tannerwelsh merged commit 01ed633 into master Nov 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants