Even Number Generator

Published by Matt in

Create a function that finds all even numbers from 1 to the given number.

Examples

find_even_nums(8) ➞ [2, 4, 6, 8]

find_even_nums(4) ➞ [2, 4]

find_even_nums(2) ➞ [2]

Notes

If there are no even numbers, return an empty array.

Watch a quick demo on how Edabit works.