Could you please provide some examples or references related to the next task:
var planets = [{
residents: [{
name: 'Mars'
},
{
name: 'Jupiter'
},
{
name: 'Saturn'
}
]
},
{
residents: [{
name: 'Mars'
},
{
name: 'Saturn'
}
]
}
]
In
<input type='text'>
If I type "Mars and Jupiter" - I expect to get planets[0] object
If I type "Mars and not Jupiter" - I aim to retrieve planets[1] object
The QUERY is how do you analyze the text and determine where the keywords AND and NOT are located? I hope my explanation was sufficient. Thank you in advance and have a wonderful day!