I have an object in key/value pairs that may contain boolean values. I need to evaluate the type of the value so I know what to return. So let's say I have an object that looks like:
{
aKey: false,
anotherKey: 4,
yetAnotherKey: true
}
I want to loop through each key/value pair there and do something different depending on the type of the value. If I use Object.keys(options).map((key, index)
, it transforms the boolean values from true/false to 0/1, so I have no way of knowing that those are actually booleans.
What is the best way to go about this?