#7DaysJS: Primes Until n
Lautaro Lobo

Lautaro Lobo @lautarolobo

About: While you read this I'm learning something new.

Location:
Córdoba, Argentina
Joined:
May 6, 2019

#7DaysJS: Primes Until n

Publish Date: Dec 5 '19
5 0

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?'
Enter fullscreen mode Exit fullscreen mode

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.

Comments 0 total

    Add comment