Project Euler Problem 6 - JavaScript