Skip to content

Instantly share code, notes, and snippets.

View anabastos's full-sized avatar
🛶
De boa na lagoa

Ana Luiza Portello Bastos anabastos

🛶
De boa na lagoa
View GitHub Profile
/**
* Show Me the Evens - Show me the Odds
* Diana is learning to count and she just learned the difference between odds and even numbers.
* She wants to have some fun, so she picks a random number.
* If that number is even, she decides to count all the even numbers up to it starting from 0 up to (but not including) the input.
* If not, she decides to count all the odd numbers up to that number starting from 1 (but not including) the input.
**/
const counting = (x) => {
return arrayFrom(x)