find prime number function javascript es6
//#Source https://bit.ly/2neWfJ2
const isPrime = num => {
const boundary = Math.floor(Math.sqrt(num));
for (var i = 2; i <= boundary; i++) if (num % i === 0) return false;
return num >= 2;
};
console.log(isPrime(11));
console.log(isPrime(17));
console.log(isPrime(8));
Also in JavaScript:
- vscode ejs formatter
- prettier config vscode
- number to binary javascript
- bootstrap 4 modal popup remote url
- javascript get array size
- javascript remove duplicates from array
- jquery check if checkbox is not checked
- clone an object javascript
- node command get to much time
- keydown shift tab angular
- node code comment process real time
- check if input is a number javascript
- get uislider
- how to check if 2 images are touching js
- convert app function to class component react native
- event listener to elements with class
- math.floor js
- how to install node js in ubuntu
- javascript title string
- variables 2 python .Bartolome sintes Marco
- get syntethicbaseevent and parameter in react
- get length of array
- js detect mouse support
- how to connect next js with postgresql localhost