I am looking to implement a search functionality in JavaScript using an array, filter, and keyword. The goal is to search through the array based on the filter and keyword provided, and return a new array of objects similar to the original one.
var data = [
{email: "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="9eebedfbecffdef9f3fff7f2b0fdf1f3">[email protected]</a>",nama:"User A", Level:"Super Admin"},
{email: "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="9feaecfaedfddff8f2fef6f3b1fcf0f2">[email protected]</a>",nama:"User B", Level:"Super Admin"},
{email: "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="7f0a0c1a0d1c3f18121e1613511c1012">[email protected]</a>",nama:"User C", Level:"Standart"},
{email: "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6a1f190f180e2a0d070b030644090507">[email protected]</a>",nama:"User D", Level:"Standart"},
{email: "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="8cf9ffe9fee9ccebe1ede5e0a2efe3e1">[email protected]</a>",nama:"User E", Level:"Admin"},
{email: "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c1b4b2a4b3a781a6aca0a8adefa2aeac">[email protected]</a>",nama:"User F", Level:"Standart"}
];
var filter = "Level";
var keyword = "Standart";
//--------Search
console.log(data);