Confused on this ES6 Function Practice Problem
Here is the problem and the code I have written so far: You have created an array containing the salaries of your factory workers. The manager at the factory has decided to give salary raises to his best workers and needs to the see the impact of these increases on the budget. The program you are given takes the salary percent increase as input. Complete the given function to use the percent as a parameter, then calculate and return the total salary increase for all of the workers in the array. function main() { var percent = parseInt(readLine(),10); console.log(salaryIncrease(percent)); } var salaries = [3000, 7000, 5000, 15000]; let count = 0; const salaryIncrease = percent => { //your code goes here salaries.forEach(v => { console.log(v*(percent/100)); }); }; When I use "console.log(v*(percent/100))" it outputs the percentage increase for each salary (150, 350, 250, 750), but I'm not quite sure how to get the sum of those increases to get to the answer. Would love if someone could explain how to get the sum in this scenario. Also, the problem specifically asks for me to use the forEach() function.