Here is the array that needs to be filtered
[
0: {id: 1, name: "Berlin",}
1: {id: 2, name: "Proffesor",}
2: {id: 4, name: "Oslo",}
3: {id: 6, name: "Denver",}
]
This is the filter array
[6, 16, 2, 10, 24]
Below is the pipe code snippet
export class ChatPipe implements PipeTransform {
transform(user: Users[], args: any): any { //for users i use first array and for args I use second
if (!user || !args) {
return user;
}
let filteri = user.filter(users => users.id == args);
return filteri;
};
}
I'm seeking help with filtering the first array using values from another. Can anyone assist me?