Solution for Exercise 12.1

This is a solution for Exercise 12.1. See the source code of file app.js.