102
rated 0 times
[
108]
[
6]
/ answers: 1 / hits: 5855
/ 3 Years ago, thu, april 22, 2021, 12:00:00
I am trying to make sense of this line of code:
const loanPeriod: number = get(product, 'TermMonths', this.defaultTerm) / this.monthsInAYear;
defaultTerm and monthsInAYear are global variables. product is an object and TermMonths is a number property of product. I don't know why the product & 'TermMonths' is needed. Can't you just divide the defaultTerm by monthsInAYear?
More From » typescript