Why minimum payments take 19 years: simulating credit card payoff in JavaScript
A month-by-month credit card simulation in about 20 lines of JavaScript, why there's no neat closed-form answer for minimum payments, and the edge cases (negative amortization, the last payment) that trip up naive code.