BeatMix project assistance!

Hello everyone, im currently doing the “beatmix” project and I have an issue with one of my functions. I’m not able to make it pass the tests. Any ideas what have i done wrong. Thank you!

function clear (drumType) {
if (drumType !== ‘kicks’ && drumType !== ‘snares’ && drumType !== ‘hiHats’ && drumType !== ‘rideCymbals’) {
return
}
switch (drumType) {
case ‘kicks’:
kicks.forEach(step => step = false);
break;
case ‘snares’:
snares.forEach(step => step = false);
break;
case ‘hiHats’:
hiHats.forEach(step => step = false);
break;
case ‘rideCymbals’:
rideCymbals.forEach(step => step = false);
break;
}
};
test outcome:
clear() function
✓ should exist and be a function
✓ should perform no array mutation when called with no arguments
✓ should not perform any mutation when called with an invalid array name
1) mutates only a single array at a time
2) should set all values in an array to false when called with a valid array name

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.