My JS code for the first project Euler problem