-
Notifications
You must be signed in to change notification settings - Fork 0
JavaScript the Good Parts
Ok so Doug Crockford is pretty smart. And you've got to love his diagrams. And the fact that he pushed JSON usage to most modern mainstream applications. Not sure about Shakespeare quotes thought :).
This is not a beginner book so if you're just learning JavaScript look somewhere else first and return to this book after at least a couple of months of experience with the language.
- pg. 11/12 - JavaScript's falsy/truthy values
- pg. 13 - Making sure that the property is on the object itself, not on its prototype with
obj.hasOwnProperty(prop) - pg. 17 - Short-circuit evaluation with the || operator
- pg. 21 - Short-circuit evaluating properties on an object
- pg. 24 - Looping over object properties (Enumeration)
- pg. 24 - The
deleteoperator (removes a property from an object)
- pg. 30 -
.apply()function methods
- pg. 50 - It's more convenient to put multiple function parameters into an object.
- pg. 52 - Functional inheritance pattern. A useful solution for making objects that have private members.
Great chapter on JS regular expressions. Good to review when needed.
A great Array, Function, Number, Object, RegExp and String method reference.
- pg. 78 - Array Methods
- pg. 84 - Function Methods
- pg. 84 - Number Methods
- pg. 86 - Object Methods
- pg. 86 - RegExp Methods
- pg. 88 - String Methods
An ok starting point for JS style I guess. The thing that bothers me though is that Crockford uses underscore style in the book sometimes when he should use camel case (e.g. not_in_array instead of notInArray).
- pg. 104 - Parsing strings starting with 0 to integeres with parseInt('09', 10)
- pg. 104 - Floating Point arithmetic. Important when working with money.
- pg. 140 - JSON parser implementation.
Generally, the craft of programming is the factoring of a set of requirements into a set of functions and data structures.
