Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 63db591

Browse files
committed
Fix code example for duplicate code
1 parent 578f35c commit 63db591

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -440,11 +440,15 @@ function showEmployeeList(employees) {
440440
const expectedSalary = employee.calculateExpectedSalary();
441441
const experience = employee.getExperience();
442442

443-
let portfolio = employee.getGithubLink();
444-
445-
if (employee.type === 'manager') {
446-
portfolio = employee.getMBAProjects();
447-
}
443+
let portfolio;
444+
switch (employee.type) {
445+
case 'manager':
446+
portfolio = employee.getMBAProjects();
447+
break;
448+
case 'developer':
449+
portfolio = employee.getGithubLink();
450+
break;
451+
}
448452

449453
const data = {
450454
expectedSalary,

0 commit comments

Comments
 (0)