Question: const increment = (x) => x + 1; // increment function please show and explain the code and result. thank you. Create a function called

const increment = (x) => x + 1; // increment function
please show and explain the code and result. thank you.
Create a function called forEach that takes two inputs: - an array of numbers (a list of numbers) - a 'callback' function forEach runs the callback on each element of the array (updates the array passed in). forEach does not return anything. (8 pts.) myarray =[2,3,4]; forEach(myarray, increment); console.log(myarray); // should output [3,4,5] (3 pts.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
