Prime checker
JavaScript
Easy
Objective
Write a function that checks if a number is a prime number.
Requirements
The function should be named
isPrimeThe function should take a single number as an argument
The function should return
trueif the number is prime, andfalseif 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 |