516-346-2999 — [email protected]
Please fill out all required fields correctly.
"; return; } const yearsToRetirement = retirementAge - currentAge; let totalContribution = currentBalance; for (let year = 0; year < yearsToRetirement; year++) { const yearlyContribution = (annualSalary * Math.pow(1 + salaryIncrease, year)) * contributionRate + employerMatch; totalContribution += yearlyContribution; totalContribution *= (1 + expectedReturn); } const realValueAtRetirement = totalContribution / Math.pow(1 + inflationRate, yearsToRetirement); document.getElementById('result').innerHTML = `Your estimated total balance at retirement is $${totalContribution.toFixed(2)}.
Adjusted for inflation, the estimated value is $${realValueAtRetirement.toFixed(2)}.
`; }