Luhn Algorithm in JavaScript