I need some help but I just can not find a way to solve that little doubt I have, I'm trying to make a comparison to get true / false from an Object in JavaScript, for example I have that result in the Chrome console:
{sortBy: "price_asc"}
Taking into account that the variable is an object but how can I get from that variable that the value is "price_asc" = true
, try with Object.keys () but returns me ["sortBy"]
There is some way to get in the if for example:
if (Object.keys(this.searchParams) === 'price_asc') {
return null;
}
It is appreciated if someone can clarify that doubt.