'How can I remove objects from an array if a property is in another array? [duplicate]

I want to slice an object from an array in React Native. Let's assume my object is like this:

const data = [
 {"name": "alex", "subject": "english" "student_id": "1"},
 {"name": "hales", "subject": "science" "student_id": "2"},
 {"name": "joss", "subject": "english" "student_id": "3"},
 {"name": "alexandra", "subject": "science" "student_id": "4"},
]

const ids = ["3", "4"];

I want to slice those array elements having student_id equal to ids



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source