7 kyu

Array of Primes

Description:

Your task is to take a given range and return an array of the prime numbers in that range.

You will write a function with the following parameters:

start is the integer from which your range starts. (inclusive)

end is the integer at which your range ends. (inclusive)

If the range does not contain any prime numbers return null.

Examples:

primes(5, 7)  // [5, 7]
primes(8, 9)  // null
primes(1, 10) // [2, 3, 5, 7]
primes(5, 7)  # [5, 7]
primes(8, 9)  # None
primes(1, 10) # [2, 3, 5, 7]
primes(5, 7)  # [5, 7]
primes(8, 9)  # nil
primes(1, 10) # [2, 3, 5, 7]
Fundamentals

Stats:

CreatedDec 28, 2015
PublishedDec 28, 2015
Warriors Trained887
Total Skips32
Total Code Submissions1600
Total Times Completed475
JavaScript Completions475
Total Stars16
% of votes with a positive feedback rating89% of 104
Total "Very Satisfied" Votes83
Total "Somewhat Satisfied" Votes19
Total "Not Satisfied" Votes2
Ad
Contributors
  • tdowek1 Avatar
  • ooflorent Avatar
  • GiacomoSorbi Avatar
  • Voile Avatar
  • ejini战神 Avatar
Ad