Challenge: Solution Review
This lesson will explain the solution to the problem from the previous coding challenge.
We'll cover the following...
We'll cover the following...
Solution #
Explanation
To make the problem easier to understand, let’s start by converting it to a diagram.
If you follow the diagram and the code, you’ll see that there is an abstract Loans constructor function. Its purpose is to instantiate an instance of a specific loan constructor, depending on the parameters given.
From the diagram above, you can see that three types of loan objects can be instantiated:
-
PersonalLoan -
StudentLoan -
HomeLoan
These loans, in turn, have different types available. In our coding challenge, we do not go into these subcategories. However, knowing this will ...