score:3

Accepted answer
const arrayFilter = (oldArray: TObject[], keyOldArray: (keyof TObject)[]) => {
  return oldArray.filter((item, index) => item[keyOldArray[index]] === somethingConst);
};

Related Query

More Query from same tag