primitive numbers javascript coding sample increas by 1
function test_prime(n){
if (n===1) {
return false;
}else if(n === 2){
return true;
}else{
for(var x = 2; x < n; x++){
if(n % x === 0){
return false;
}
}
return true;
}
}
console.log(test_prime(37));
Also in JavaScript:
- js date in two weeks
- switch in javascript
- get serialize data javascript
- if variable is string javascript
- update object in react hooks
- typeface in gatsby
- javascript cut string if too long
- javascript convert a number in string
- bind in javascript
- switch in react
- disable right click jquery
- How to Use the JavaScript Fetch API to Get Data
- v-switch vuex store
- map with async
- how to get the number of days in a month in javascript
- javascript get random string
- js remove readonly attribute
- include partials ejs
- how to convert jsonobject
- alphabet only in jquery
- set auto-hide toast javascrpt
- primitive numbers javascript coding sample increas by 1
- react createelement
- javascript get number of elements in object