I have below response from a graphql query:
"menu": [{
"url": ""
},
{
"url": "/"
},
{
"url": "/item/child-item"
}
]
I need a Boolean variable and check if there is an item in the Array with two (or more) forward slashes /. So it has a child-item in the path like "/item/child-item"
const hasChild = data.menu.map((item) => item.url.includes('// What to do here?'));
//or starts with//?/but not necessarily together? (Your third example.) With a question like this, it's always useful to show examples that match and don't match and to say specifically which are which.