I have an object containing a checklist below that I would like to get values from.
colors = {
green: true,
blue: true,
red: true,
orange: false
}
How will I get the value (e.g. true/false) just by using the keys?
Pseudocode:
const isUsed = (color) => {
return if true or false given the color
}
Expectations:
console.log(isUsed("green"));
//logs true