Type something to search...
7 Days of JS: Primes Until n

7 Days of JS: Primes Until n

  • JavaScript
  • Challenge
  • Lautaro Lobo
  • 05 Dec, 2019

Welcome to day 7 of 7 Days of JavaScript!

Today, on the last day of this challenge, we will tackle a hard one.

Write a function that takes a Natural number n, which returns all the primes from 0 to n and a string at the end with some phrase.

Example:

primesUntil(7)
...
2
3
5
'Why the string?'

Hint: you may want to use a helper function.

Give it time. If you feel frustrated, go take a walk and then sit down to try it again.

And then, read the solution here.


Related Posts