Compleated js exercise3