Ayman Hourieh covers some interesting manipulation of Arrays that accommodates typical data structures. He also covers how to bind methods to objects, sorting with custom functions. He shows a custom AssertException, and covers using Firebug for debugging. He covers some JavaScript quirks: static local variables, null, undefined and delete.
Jon Raasch's notes on Nicholas Zakas's Google Tech Talk "Speed Up Your JavaScript" in which he covers basic performance improvements like local variables for more expensive lookups, avoiding for in loops, casting DOM array-like objects into proper arrays, avoid touching the DOM, use classes to change CSS instead of inline styles.
Based on Simon Willison's original 2005 eTech talk, Simon expands this into a full article covering the expressive functionality of JavaScript. He covers the basics of JavaScript: literals, variables, functions, scope, control flow, objects, classes, inner functions and closures. Everything a developer needs to know before diving into more advanced JavaScript.
Cory Hudson sees callbacks as benefiting from currying JavaScript functions, and defines currying as turning a function with two arguments into a function with one argument that returns a function of one argument. He starts off with two functions and shows how to combine them into one curried function, and also builds a generic version. He shows a good usage of a curried function in an array map()
function, which is similar to Prototype's bind()
.
Erik Arvidsson warns against extending the JavaScript Object with Object.prototype, as it can lead to breakages in third party code when they use the for(key in obj) method of iterating through any class (since they all are subclasses of Object). Instead Erik recommends extending the classes that directly benefit from the extending functions, and treat Object as a final constant. Erik also suggests that hashes and associative arrays should be done in JavaScript using Object, not Arrays.
Douglas Crockford's useful utility that looks for potential problems in JavaScript code. Produces warnings like improper use of eval, and places where a dot operator is better than an array-like reference. An excellent tool to use before running JavaScript through a minifier. JSLint is actually a JavaScript parser written in JavaScript