get the whole value of a number javascript
var value = 2.9802453587962963;
var wholeNum = Math.floor(value);
console.log(wholeNum); // output ==> 2
get the whole value of a number javascript
var value = 2.9802453587962963;
var wholeNum = Math.floor(value);
console.log(wholeNum); // output ==> 2
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));
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us