Committing euler nine, ten and twelve in JS