mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
646 B
646 B
FikBuk
Instructions
Create a fikBuk
function that takes a number n
and will start counting from
1
to n
.
You will return create an array from those values
for each numbers in between 1
and n
you must do the following:
- if the number is a multiple of
3
addFik
to the array - if the number is a multiple of
5
addBuk
to the array - if the number is a multiple of both
3
and5
addFikBuk
to the array - otherwise add the number to the array
Example:
fikBuk(3) // -> [1, 2, 'Fik']
fikBuk(5) // -> [1, 2, 'Fik', 4, 'Buk']
fikBuk(16) // -> [...7, 8, 'Fik', 'Buk', 11, 'Fik', 13, 14, 'FikBuk', 16]