Add section on JavaScript chaining

Adapted from the version in the whitehall styleguide.