Homework 2 javaScript