Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a class that keeps track of groups and group members (Javascript) The class should track names of the groups, a group leader and group
Write a class that keeps track of groups and group members (Javascript)
The class should track names of the groups, a group leader and group members.
Each group should look like: { name: 'Group Name' leader: 'Leader Name' members: ['Name 1', Name 2'] }
The class should have the following methods:
constructor: accepts an array of group objects or if nothing is passed - defaults to an empty array
addGroup(group): adds a group
removeGroup(groupName): removes a group by the name of the group
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started