users = [
{
"username": "Alice",
"firstName": "Alice-U",
"lastName": "Wonderland"
},
{
"username": "bob",
"firstName": "Bob-u",
"lastName": "Builder",
},
{
"username": "charly",
"firstName": "Charly-u",
"lastName": "Brown",
}
]
In this scenario, I am seeking a method to filter the user array based on multiple criteria. For instance:
Search Criteria: { "username" : "Alice" }
would yield:
{
"username": "Alice",
"firstName": "Alice-U",
"lastName": "Wonderland"
}
For example:
{ "username" : "charly", "firstName": "Charly-u" }
should return :
{
"username": "charly",
"firstName": "Charly-u",
"lastName": "Brown",
}
The goal is to achieve precise string matching utilizing either JavaScript or jQuery.