I have an object like
const myObj = {
policy : {
title: "policy title",
page : "/pageOne"
},
purchase : {
title: "purchase title",
page : "/pageTwo"
}
}
I need to search through this object and find where page is "/pageTwo" and return not just the title but also the key (ie purchase)
Is there a simple way to do this in TS?