JavaScript Patterns book practice