Mortgage payment Calculator
Write a script that stores the mortgage loan amount, apr, and term, and uses those values to calculate the monthly payment. It will use the following formula:
P * r / n P = Loan amount
------------------- r = APR (e.g. 0.08)
1 - (1 + r/n)^-nt n = Number of payments made per year
t = Term (years)
- Have it display the value to the console with no more than 2 decimals
Hint: Code for displaying a number to 2 decimals
Specify precision within the parenthesis of the toFixed() function
var answer = ...
console.log(answer.toFixed(2))