adding javascript example code
updating code with corrections from presentation