This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Task description */ | |
/* | |
Write a function that finds all the prime numbers in a range | |
1) it should return the prime numbers in an array | |
2) it must throw an Error if any on the range params is not convertible to `Number` | |
3) it must throw an Error if any of the range params is missing | |
*/ | |
function findPrimes(from, to) { | |
if (isNaN(Number(from)) || isNaN(Number(to))) { |