Question: Create a class (aka blueprint) for your Course class. The class constructor should take the course id and the course name as parameters and set
- Create a class (aka blueprint) for your Course class. The class constructor should take the course id and the course name as parameters and set them as properties. It should also initialize a property to an empty array that will be used to represent the list of students in the course. This list can contain anything (strings, numbers, etc.). Your Course class shouldnt care about whats added to this list.
- Add a prototype method, add, to the Course class that adds the given student to the list of students in the course. Make sure not to add a student twice.
- Add a prototype method, remove, to the Course class that removes the given student, passed as an argument, from the list of student
In java scripts
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
