javaScript practice with Euler challenges