Build a simple mortgage calculator widget that takes in a loan amount, interest rate, loan term, and calculates the monthly mortgage payment, total payment amount, and total interest paid.
The last two requirements might not be given to you during interviews, you're expected to clarify.
The formula for calculating the monthly payment is:
M = P(i(1+i)n)/((1+i)n - 1)
Here's an example of Google's mortgage calculator (you might need to be in the US for it to appear):
This question is adapted from FrontendEval's Mortgage Calculator.
Want to grow in your front end skills? Learn them the right way — build apps step-by-step while referencing best practices from Senior engineers.
Want to grow in your front end skills? Learn them the right way — build apps step-by-step while referencing best practices from Senior engineers.
Build a simple mortgage calculator widget that takes in a loan amount, interest rate, loan term, and calculates the monthly mortgage payment, total payment amount, and total interest paid.
The last two requirements might not be given to you during interviews, you're expected to clarify.
The formula for calculating the monthly payment is:
M = P(i(1+i)n)/((1+i)n - 1)
Here's an example of Google's mortgage calculator (you might need to be in the US for it to appear):
This question is adapted from FrontendEval's Mortgage Calculator.
Want to grow in your front end skills? Learn them the right way — build apps step-by-step while referencing best practices from Senior engineers.
console.log()
语句将显示在此处。