update JavaScrpt example