Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!