Skip to content

Latest commit

 

History

History

355-onlyEvens

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

onlyEvens

Interview question of the issue #355 of rendezvous with cassidoo.

The Question

Write a function that takes an array of integers and returns a new array containing only the even numbers, and sorted.

Example:

> onlyEvens([1, 2, 3, 4, 5, 2])
> [2, 2, 4]

> onlyEvens([7, 8, 1, 0, 2, 5])
> [0, 2, 8]

> onlyEvens([11, 13, 15])
> []

Installing & Running

Just pnpm i to install all dependencies and then pnpm t to run the tests!