primitive numbers javascript coding sample increas by 1

Solutions on MaxInterview for primitive numbers javascript coding sample increas by 1 by the best coders in the world

showing results for - "primitive numbers javascript coding sample increas by 1"
Castor
23 Apr 2016
1function test_prime(n){
2  if (n===1) {
3    return false;
4  }else if(n === 2){
5    return true;
6  }else{
7    for(var x = 2; x < n; x++){
8      if(n % x === 0){
9        return false;
10      }
11    }
12    return true;  
13  }
14}
15
16console.log(test_prime(37));
similar questions