- 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; } }
2 Réponses
0
What's the task Description ?
And what are you doing by this line?
total = items += items;
0
It´s already fixed. I overwrited items without realising my own