CODE IN JAVASCRIPT
Consider the following the square function and nums array.
a. Use the square function along with the array map function tosquare the elements of numsarray and assigned the results tosquaredNums. Then Display squaredNums.
b. Enhance the implementation done in previous question byremoving the square function and using anonymous arrowfunction.
function square(x) {
return x * x; }
let numbers = [1, 2, 3, 4, 4, 5, 6, 7, 8, 9, 10];
14. Consider the following array:
let nums = [1, 2, 3, 4, 5, 6, 7, 8];
-
Use filter then map array functions to filter even numbers thensquare them. Assign the
results to a variable named squaredEvenNums
ORPayPal Gateway not configured
ORPayPal Gateway not configured