Reputation: 51
Learning JSX here and I was wondering if theres a way to check if a value appears in a object in JavaScript
i.e We have an obj: anObj ={ myFoo : "MONDAY;TUESDAY;WEDNESDAY" }
How could I check if monday etc appears in this object?
Upvotes: 0
Views: 781
Reputation: 241
You can find the value in Object.values with .includes()
let valueExists = Object.values(obj).includes("value you looking for");
Upvotes: 2