Skip to content

Latest commit

 

History

History
12 lines (10 loc) · 468 Bytes

detect-prime-in-array.md

File metadata and controls

12 lines (10 loc) · 468 Bytes

Given an array of numbers , write a function that detects if any of the numbers in the array is prime or not. If it detects a prime number it returns true. If there are no prime numbers in the array it returns false

Note: You have to reuse the Check Prime function we created earlier

// Copy your checkPrime function here

function detectPrime(arr){
}
console.log(detectPrime([15,110,7,22,25]));// true
console.log(detectPrime([15,110,77,290,20]));// false