Project Euler problems resolved with JavaScript