- 2

Count salary workers with % off

function main() { var salaries = [3000, 7000, 5000, 15000]; var percent = 10; /* This is 10% off */ var factory = new Factory( salaries , percent ); console.log(salaryIncrease(factory.salaries,factory.percent)); } const salaryIncrease = (salaries,percent) => { //your code goes here salaries.map( function( salaries ){ return (salaries * percent) /100; } ).forEach(( items )=>{ total += items }) return total } class Factory{ constructor( salaries , percent ){ this.salaries = salaries; this.percent = percent; } }

22nd Mar 2022, 12:17 PM
ivan gonzalez
ivan gonzalez - avatar
2 Réponses
0
What's the task Description ? And what are you doing by this line? total = items += items;
22nd Mar 2022, 1:01 PM
Ipang
0
It´s already fixed. I overwrited items without realising my own
22nd Mar 2022, 6:17 PM
ivan gonzalez
ivan gonzalez - avatar