Filtruj tablicę JSON na podstawie wielu argumentów, w tym list

 const array = [{ sector_code: ..., listed_in: ... }]; // your array
  const listed_inilter = ['KSE100', 'KMIALLSHR'];
  const sector_code = ['0833', '0824'];

  function array_subset() {
     return array.filter(element => {
       const is_listed = listed_inilter.some(item => element.listed_in.includes(item));

       const is_sector = sector_code.includes(element.sector_code);

       return (is_listed || is_sector)
  });
}

console.log(array_subset()); // output the filtered list
    
SAMER SAEID