How to determine whether an array object has a value, and then return the array of objects with this value. Because I'm a novice, Similar to fuzzy search, give an example:
const menu = [
{
title: "one",
secondLevel:{
name:"hellobye",
children: [{name: "hello"}, {name: "bye"}],
}
},
{
title: "two",
secondLevel:{
name:"level",
children: [{name: "good"}, {name: "night"}],
}
}
]
- Assume input "go", the result should be:
menu = [
{
title: "two",
secondLevel:{
name:"level",
children: [{name: "good"}, {name: "night"}],
}
}
]