I am having array in following format
"categories": [
  {
     "type": "A",               
     "subtype": [
        "X",
        "Y",
        "Z",
        "D",
         "E"           
     ],
  },
  {
     "type": "B",
     "Subtypes": [
        "0",
        "1",
        "2",
        "3",
        "4",
        "5"
     ],        
  },
  {
     "type": "C",         
     "includeConnectionTypes": [
        "@",
        "#",
        "$"
     ],
}]
I am having 2nd array array B
B = ["C","A"]
now how to filter elements in category array based on elements in array B
 
     
     
     
    