0

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

isherwood
  • 52,576
  • 15
  • 105
  • 143
alex
  • 53
  • 6

0 Answers0