for (let bank of bankBtns) {
bank.addEventListener('click', () => {
for (let item of bankBtns) {
item.classList.remove('active');
}
bank.classList.add('active');
takeActiveBank(bank);
});
}
for (let input of inputsRange) {
input.addEventListener('input', () => {
assignValue();
calculation(totalCost.value, /*anInitialFee.value,*/ creditTerm.value);
});
}
const calculation = (totalCost = 650000, /*anInitialFee = 100000,*/ creditTerm = 1) => {
let monthlyPayment; // Ежемесячный платёж
let lounAmount = totalCost; // Размер кредита
let interestRate = currentPrecent; //Процентная ставка
let numberOfYears = creditTerm; // Количество лет
let numberOfMonths = 12 * numberOfYears; // Количество месяцев
let numberOfDays = 365 * numberOfMonths; // Количество дней