const slaves = [
{ name: 'Первая', age: 26, spec: 'Анал', pay: 1500, exp: 1 },
{ name: 'Вторая', age: 18, spec: 'Петтинг', pay: 400, exp: 0 },
{ name: 'Третья', age: 22, spec: 'Классика', pay: 2500, exp: 3 },
{ name: 'Четвертая', age: 29, spec: 'Минет', pay: 700, exp: 2 },
{ name: 'Пятая', age: 36, spec: 'Все включено', pay: 5500, exp: 3 },
];
const factors = {
novice (money) { return this.bonus(money + money / 100 * 10) },
expert (money) { return this.bonus(money + money / 100 * 20) },
bonus (money) { return money < 4000 ? money += 1000 : money += 500 }
}
for (let obj of slaves) {
if (obj.exp >= 1 && obj.exp < 3) {
obj.pay = factors.novice(obj.pay);
} else if (obj.exp >= 3) {
obj.pay = factors.expert(obj.pay);
} else {
obj.pay = obj.pay;
}
}