<commit_before>// How would you verify a prime number?

 // a prime number is only divisible by itself and 1.
 // So, i will run a while loop and increase by 1.


function isPrimeNumber(n){
    var divisor = 2,
        counter = 0;
    while (n > divisor) {
      if (n % divisor === 0) {
        return false
      } else {     // the divisor is increased 1 at a time. after 3 i can increase by 2.
                   // if a number is divisible by any even number, it will be divisible by 2.
        if (divisor > 2) divisor++
      }
      counter++
    }
    return true;
};


// --------------------------------------------------------------------------

function isPrimeNumber(n){
    for(var x = 2; x < n; x++){
      if(n % x === 0) return false;
    }
    return n > 1
};

console.log(isPrimeNumber(2))
<commit_msg>add logic<commit_after>// How would you verify a prime number?

 // a prime number is only divisible by itself and 1.
 // So, i will run a while loop and increase by 1.


function isPrimeNumber(n){
    var divisor = 2,
        counter = 0;
    while (n > divisor) {
      if (n % divisor === 0) {
        return false
      } else {     // the divisor is increased 1 at a time. after 3 i can increase by 2.
                   // if a number is divisible by any even number, it will be divisible by 2.
        if (divisor > 2) divisor++
      }
      counter++
    }
    return true;
};


// --------------------------------------------------------------------------

function isPrimeNumber(n){
    for(var x = 2; x < n; x++){
      if(n % x === 0) return false;
    }
    return n > 1 // if 1 return false, if 2 return true by default
};

console.log(isPrimeNumber(2))

{'fraction_non_alphanumeric': 0.18735224586288415, 'fraction_numerical': 0.01773049645390071, 'mean_word_length': 1.4933726067746687, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '7645122', 'n_tokens_mistral': 530, 'n_tokens_neox': 475, 'n_words': 211}