add the book javascript pattern