Returns true if given card number is valid
function checkLuhn ( cardNo ) { let nDigits = cardNo . length ; let nSum = 0 ; let isSecond = false ; for ( let i = nDigits - 1 ; i >= 0 ; i -- ) { let d = cardNo [ i ] . charCodeAt ( ) - ' ' . charCodeAt ( ) ; if ( isSecond == true ) d = d * 2 ;