So I have been trying to solve this for awhile now and can not wrap my head around why test 4 keeps returning the whole object instead of just the keys.
This is what I have so far:
`export const colorCode = (color) => {
const colorsKeys = Object.keys(COLORS);
if (color === COLORS) {
return colorsKeys;
} else {
return COLORS[color];
}
return colorsKeys;
}
export const COLORS = {"black": 0, "blue": 6, "brown": 1, "green": 5, "grey": 8, "orange": 3, "red": 2, "violet": 7, "white": 9, "yellow": 4};`
I have tried to re word this in many different ways, different conditionals, == versus ===, and still keep running into the same problem on test 4. Whenever I try and return colorsKeys to satisfy the last test it returns the entire object, values and all. I have even tried just returning just colorsKeys and removing all other code besides the line where I assign colorsKeys its value. In the first 3 tests colorsKeys functions as expected by returning just the keys from the COLORS object, but when test 4 is run it returns the entire object with the value pair.
I can not figure out why colorsKeys would return two different values. Any help would be greatly appreciated!