Advertisement
Guest User

Untitled

a guest
Jan 21st, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function solution(dataArray) {
  2.     let [principalSum, interestRatePercent, periodInMonths, timeSpanInYears] = dataArray;
  3.     let compoundInterest = principalSum * Math.pow(1 + interestRatePercent/(100*( 12/periodInMonths)), 12/periodInMonths * timeSpanInYears);
  4.     console.log(compoundInterest);
  5. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement