basic javascript from book reference