Prime checker

JavaScript
Easy

Objective

Write a function that checks if a number is a prime number.

Requirements

  1. The function should be named isPrime

  2. The function should take a single number as an argument

  3. The function should return true if the number is prime, and false 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