Prime checker
JavaScript
Easy
Objective
Write a function that checks if a number is a prime number.
Requirements
The function should be named
isPrime
The function should take a single number as an argument
The function should return
true
if the number is prime, andfalse
if it is not
Check your solution
Tests
Function name is isPrime | |||
isPrime(1) | Expected: | false | |
isPrime(2) | Expected: | true | |
isPrime(10) | Expected: | false | |
isPrime(29) | Expected: | true | |
isPrime(7919) | Expected: | true |