Javascript Homework #2

Are you ready for homework #2 ?

well, here it is :

Let’s say you are working for a factory that sales high-end machines. and your new boss come up with an amazing idea for your new factory’s product.

a machine that gets a series of numbers, and knows how to add a number that is exactly twice the number it gets!

for example, if you run into the machine the numbers [1, 2, 3, 4], the machine will return [2,4,6,8]

write a function that will take an array of numbers, loop through those numbers, and return an array of numbers that is exactly twice the numbers you got!

 

if you want a solution, here it is :

solution