Skip to content

Commit 7ea3d95

Browse files
committed
reversing-conds: reverse 'interestRate and duration are positive' structure
1 parent 5347529 commit 7ea3d95

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/reversing-conditions/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export function adjustedCapital(anInvestment) {
22
let result = 0;
33
if (anInvestment.capital <= 0) return result;
4-
if (!(anInvestment.interestRate > 0 && anInvestment.duration > 0)) return result;
4+
if (anInvestment.interestRate <= 0 || anInvestment.duration <= 0) return result;
55
result = (anInvestment.income / anInvestment.duration) * anInvestment.adjustmentFactor;
66
return result;
77
}

0 commit comments

Comments
 (0)