Created solution to Project Euler Problem #1 in JS