Use a javascript file to create an array called numArray that holds the numbers 1 through 50. ( [ 1, 2, 3, 4, ... 50 ] ). Use the map() method on the array and an arrow function to transform the array into 50 multiples of 5 ( [ 5, 10, 15, 20, ... 250 ]. (Make sure you assign the result of the mapping back to the numArray array itself in this and the following steps.) Print the result to the console. Then use the map() method with an arrow function to set all multiples of 3 to zero ( [ 5, 10, 0, 20, 25, 0, 35, 40, 0, ... ] ). Print the result to the console. Then use the map() method to subtract 1 from all multiples of 10 that are greater than 1 ( [5, 9, 0, 19, 25, 0, 35, 39, 0, ... ] ). Print the result to the console. * numArray should hold this final result.
* Use a javascript file to create an array called numArray that holds the numbers 1 through 50. ( [ 1, 2, 3, 4, ... 50 ] ). Use the map() method on the array and an arrow function to transform the array into 50 multiples of 5 ( [ 5, 10, 15, 20, ... 250 ]. (Make sure you assign the result of the mapping back to the numArray array itself in this and the following steps.) Print the result to the console. Then use the map() method with an arrow function to set all multiples of 3 to zero ( [ 5, 10, 0, 20, 25, 0, 35, 40, 0, ... ] ). Print the result to the console. Then use the map() method to subtract 1 from all multiples of 10 that are greater than 1 ( [5, 9, 0, 19, 25, 0, 35, 39, 0, ... ] ). Print the result to the console.
* numArray should hold this final result.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps