Updates sample JavaScript code.