Implemented javascript portion of the assignment.