Skip to content

Latest commit

 

History

History

arrowfunc-challenge

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Creating arrowfunc-challenge project

Learning arrow functions:

Complete the function modiffyArray. It has one parameter: an array, nums. It must iterate through the array performing one of the following actions on each element:

  • If the element is even, multiply the element by 2.
  • If the element is odd, multiply the element by 3.

The function must then return the modified array.

Constraints:

  • 1 <= n <= 10
  • 1 <= numsi <= 100, where numsi is the ith element of nums.

Sample input:

1 2 3 4 5


Sample output:

3 4 9 8 15