Example scripts accompanying a book chapter on JavaScript