Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

prime or not in javascript

function isPrime(num) {
  for(var i = 2; i < num; i++)
    if(num % i === 0) return false;
  return num > 1;
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript Get Key/Values of Map 
Javascript :: p5js circle 
Javascript :: how to get folder names with fs 
Javascript :: javascript generate random number 
Javascript :: random letter from a name js 
Javascript :: i18n vue cli 
Javascript :: prettier vscode settings 
Javascript :: change value of variable javascript 
Javascript :: javascript object array contains 
Javascript :: encode jwt token javascript 
Javascript :: contains() js 
Javascript :: Downward Triangle Star Pattern in JavaScript 
Javascript :: javascript key event 
Javascript :: dom element set id 
Javascript :: js json data undefined 
Javascript :: stop a site from reloading javascript 
Javascript :: preloader 
Javascript :: javascript code to open excel file and read contents 
Javascript :: countdown in js 
Javascript :: how to set emmet for jsx in visual studio code 
Javascript :: how to change the background color of html in javascript 
Javascript :: js know size of screen displayed 
Javascript :: export default method vue 
Javascript :: css class list 
Javascript :: how to convert set to a string in js 
Javascript :: mongodb mongoose push into nested array 
Javascript :: for loop string array javascript 
Javascript :: reverse string with recursion 
Javascript :: javascript redirect with extra url arguments 
Javascript :: assign array to another array javascript 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =