Code samples from Professional Javascript for Web Developers