{"size": 829, "ext": "js", "max_stars_repo_path": "December-02/question2.js", "max_stars_repo_name": "OliverKowalski/A-December-of-Algorithms-2019", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "December-02/question2.js", "max_issues_repo_name": "OliverKowalski/A-December-of-Algorithms-2019", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "December-02/question2.js", "max_forks_repo_name": "OliverKowalski/A-December-of-Algorithms-2019", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 23.6857142857, "max_line_length": 45, "alphanum_fraction": 0.4716525935}
// Credit card if valid
console.log(validCreditCard(61789372994));
function validCreditCard(n){
    let temp = [];
    let testArray =[];
    let counter = 0;
    let sum1 =0;
    let sum2 = 0;
    // reverse values
    for (let i = 0 ; i < 11; i ++){
        temp[i] = n % 10;
        n = Math.floor(n/ 10);
    }
    // reverse the array 
    for (let i = 0 ; i < temp.length ; i ++){
        testArray[i] = temp[11-(i+1)];
    }
    // summ up the evens
    for (let i = 0 ; i < temp.length; i +=2){
        sum1 += testArray[i];
    }
    // sum up the odds
    for(let i = 1; i < temp.length; i += 2){
        if (testArray[i] *2 > 9)
            sum2 += (testArray[i] *2) -9;
        else
            sum2 += testArray[i] *2;
    }
    if ((sum1 + sum2) % 10 == 0)
        return true;
    else
        return false;
   

}