My example code from  "JavaScript: The Good Parts"