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
In this challenge, you had to use the chain of responsibility pattern to assign work to employees. We start by creating an employee. Here’s what the Employee class looks like:
class Employee
{
constructor(name,level){
this.name = name
this.level = level
}
getLevel(){
return this.level
}
getName(){
return this.name
}
}
An employee will have a name and a level. Every employee can have one of the three levels: easy, medium, or hard. The level of an employee denotes the level of tasks that they can handle. So, an employee with an easy level can only handle easy tasks and the same goes for employees with medium and hard levels.
The getLevel and ...