[resources] add section for further reading, closures. fixes #64

This commit is contained in:
Harrison Shoff
2013-07-02 10:34:21 -07:00
parent 3cea9f56f0
commit e3e3cc1a4e

View File

@@ -1192,7 +1192,7 @@
## <a name='events'>Events</a>
- When attaching data payloads to events (whether DOM events or something more proprietary like Backbone events), pass a hash instead of a raw value. This allows a subsequent contributor to add more data to the event payload without finding and updating every handler for the event. For example, instead of:
```js
// bad
$(this).trigger('listingUpdated', listing.id);
@@ -1205,7 +1205,7 @@
```
prefer:
```js
// good
$(this).trigger('listingUpdated', { listingId : listing.id });
@@ -1368,6 +1368,10 @@
- [Naming this in nested functions](https://gist.github.com/4135065) - Christian Johansen
- [Conditional Callbacks](https://github.com/airbnb/javascript/issues/52)
**Further Reading**
- [Understanding JavaScript Closures](http://javascriptweblog.wordpress.com/2010/10/25/understanding-javascript-closures/) - Angus Croll
**Books**
- [JavaScript: The Good Parts](http://www.amazon.com/JavaScript-Good-Parts-Douglas-Crockford/dp/0596517742) - Douglas Crockford