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.
- 1 <=
n
<= 10 - 1 <=
nums
i <= 100, wherenums
i is the ith element ofnums
.
1 2 3 4 5
3 4 9 8 15