<commit_before>var ccNumber = "4342562099462994"

function is_valid() {
	//this.value = this.value.replace(/[^\d]/g, '');
	//alert(ccNumber.length != 19 ? 'must be 19 numbers' : 'awesome');



console.log(ccNumber);
var ccNumRev = ccNumber.split("").reverse().join("");
console.log(ccNumRev + "   Reversed!!!");

}

 is_valid();

// Reverse the digits:<commit_msg>working validity algorithm<commit_after>var ccNumber = "4342-5620-9946-2994"

function is_valid() {
	console.log(ccNumber); //show original cc number
	ccNumber = ccNumber.replace(/[^\d]/g, ''); //remove non-numbers
	//alert(ccNumber.length != 19 ? 'must be 19 numbers' : 'awesome');
var i, l, ccNumRev;            //set variables
sum = 0;                         
ccNumRev = ccNumber.split("").reverse().join("");//reverse string
console.log(ccNumRev + "   Reversed!!!");        //show cc number reversed
for (i = 0, l = ccNumRev.length; i < l; i++) {
	num = ccNumRev[i];           //assign index to numbers
	num = +num;
if (i % 2) {                   //if index even, then * value by 2
	num *= 2;					           
	if (num < 10) {						 //adds numbers together if less than 10
		sum += num;							 //if more than 10...add number and subtract
	} else {									 //so individual digits are added ex:
		sum += num - 9;					 //3+12 should be -> 3+1+2
	} 												 //3+12-9= is the same as 3+1+2=6
} else {
	sum += num;
}console.log(num);
}
console.log(sum % 10 === 0); 
return sum % 10 === 0;
};


is_valid();

// Reverse the digits:
{'fraction_non_alphanumeric': 0.17713903743315507, 'fraction_numerical': 0.0481283422459893, 'mean_word_length': 2.5140845070422535, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6924086', 'n_tokens_mistral': 608, 'n_tokens_neox': 509, 'n_words': 145}