const all_permissions = [ { permission_id: 1, permission_name: "Getting User List", permission_method: "GET", permission_url: /^\/panel\/user$/ }, { permission_id: 2, permission_name: "Getting User Info", permission_method: "GET", permission_url: /^\/panel\/user\/[0-9]+$/ }, { permission_id: 3, permission_name: "Testing", permission_method: "GET", permission_url: /^\/panel\/test\/[a-z]+$/ } ] const my_permissions = [1,2]; const match = all_permissions.filter(p => my_permissions.includes(p.permission_id));
console.log(match)