function luhnCheck(pan) {
  var sum = 0;
  var flip = true;
  for (var i = pan.length - 1; i >= 0; i--) {
    var digit = parseInt(pan.charAt(i), 10);
    sum += (flip = !flip) ? Math.floor(digit * 2 / 10) + Math.floor(digit * 2 % 10) : digit;
  }

  return sum % 10 === 0;
}
Pass in a credit card number and it'll return if it
passes the [luhn algorithm](http://en.wikipedia.org/wiki/Luhn_algorithm)

@param {string} pan
@returns {boolean}