title: Filter array of 'objects with nested objects' using ES6 arrow functions
body: <p>How can i filter an array of objects like the one down below based on the <strong>'id'</strong> or the <strong>'subdivisions.id'</strong></p>
  
  <p>ps: the <strong>id</strong>s are unique and you can not find object.id == object.subdivisions[n].id</p>
  
  <pre><code>{
    "id": "1",
    "name": "South East",
    "subdivisions": [
      {
        "id": "2",
        "name": "Berkshire"
      },
      {
        "id": "3",
        "name": "Buckinghamshire"
      },
      {
        "id": "4",
        "name": "East Sussex"
      },
      {
        "id": "5",
        "name": "Hampshire"
      },
      {
        "id": "6",
        "name": "Isle of Wight"
      },
      {
        "id": "7",
        "name": "Kent"
      },
      {
        "id": "8",
        "name": "Oxfordshire"
      },
      {
        "id": "9",
        "name": "Surrey"
      },
      {
        "id": "10",
        "name": "West Sussex"
      }
    ]
  }
  </code></pre>
  
  <p>and get as a result a simple object like this:</p>
  
  <pre><code>{
    "id": "10",
    "name": "West Sussex"
  }
  </code></pre>
  
  <p><strong>Edit</strong></p>
  
  <p>here is the full array:</p>
  
  <pre><code>[
    {
      "id": "1",
      "name": "South East",
      "subdivisions": [
        {
          "id": "2",
          "name": "Berkshire",
          "__typename": "Region"
        },
        {
          "id": "3",
          "name": "Buckinghamshire",
          "__typename": "Region"
        },
        {
          "id": "4",
          "name": "East Sussex",
          "__typename": "Region"
        },
        {
          "id": "5",
          "name": "Hampshire",
          "__typename": "Region"
        },
        {
          "id": "6",
          "name": "Isle of Wight",
          "__typename": "Region"
        },
        {
          "id": "7",
          "name": "Kent",
          "__typename": "Region"
        },
        {
          "id": "8",
          "name": "Oxfordshire",
          "__typename": "Region"
        },
        {
          "id": "9",
          "name": "Surrey",
          "__typename": "Region"
        },
        {
          "id": "10",
          "name": "West Sussex",
          "__typename": "Region"
        }
      ],
      "__typename": "Region"
    },
    {
      "id": "11",
      "name": "London",
      "subdivisions": [
        {
          "id": "12",
          "name": "City of London",
          "__typename": "Region"
        },
        {
          "id": "13",
          "name": "City of Westminster",
          "__typename": "Region"
        },
        {
          "id": "14",
          "name": "Kensington and Chelsea",
          "__typename": "Region"
        },
        {
          "id": "15",
          "name": "Hammersmith and Fulham",
          "__typename": "Region"
        },
        {
          "id": "16",
          "name": "Wandsworth",
          "__typename": "Region"
        },
        {
          "id": "17",
          "name": "Lambeth",
          "__typename": "Region"
        },
        {
          "id": "18",
          "name": "Southwark",
          "__typename": "Region"
        },
        {
          "id": "19",
          "name": "Tower Hamlets",
          "__typename": "Region"
        },
        {
          "id": "20",
          "name": "Hackney",
          "__typename": "Region"
        },
        {
          "id": "21",
          "name": "Islington",
          "__typename": "Region"
        },
        {
          "id": "22",
          "name": "Camden",
          "__typename": "Region"
        },
        {
          "id": "23",
          "name": "Brent",
          "__typename": "Region"
        },
        {
          "id": "24",
          "name": "Ealing",
          "__typename": "Region"
        },
        {
          "id": "25",
          "name": "Hounslow",
          "__typename": "Region"
        },
        {
          "id": "26",
          "name": "Richmond",
          "__typename": "Region"
        },
        {
          "id": "27",
          "name": "Kingston",
          "__typename": "Region"
        },
        {
          "id": "28",
          "name": "Merton",
          "__typename": "Region"
        },
        {
          "id": "29",
          "name": "Sutton",
          "__typename": "Region"
        },
        {
          "id": "30",
          "name": "Croydon",
          "__typename": "Region"
        },
        {
          "id": "31",
          "name": "Bromley",
          "__typename": "Region"
        },
        {
          "id": "32",
          "name": "Lewisham",
          "__typename": "Region"
        },
        {
          "id": "33",
          "name": "Greenwich",
          "__typename": "Region"
        },
        {
          "id": "34",
          "name": "Bexley",
          "__typename": "Region"
        },
        {
          "id": "35",
          "name": "Havering",
          "__typename": "Region"
        },
        {
          "id": "36",
          "name": "Barking and Dagenham",
          "__typename": "Region"
        },
        {
          "id": "37",
          "name": "Redbridge",
          "__typename": "Region"
        },
        {
          "id": "38",
          "name": "Newham",
          "__typename": "Region"
        },
        {
          "id": "39",
          "name": "Waltham Forest",
          "__typename": "Region"
        },
        {
          "id": "40",
          "name": "Haringey",
          "__typename": "Region"
        },
        {
          "id": "41",
          "name": "Enfield",
          "__typename": "Region"
        },
        {
          "id": "42",
          "name": "Barnet",
          "__typename": "Region"
        },
        {
          "id": "43",
          "name": "Harrow",
          "__typename": "Region"
        },
        {
          "id": "44",
          "name": "Hillingdon",
          "__typename": "Region"
        }
      ],
      "__typename": "Region"
    },
    {
      "id": "45",
      "name": "North West England",
      "subdivisions": [
        {
          "id": "46",
          "name": "Cheshire",
          "__typename": "Region"
        },
        {
          "id": "47",
          "name": "Cumbria",
          "__typename": "Region"
        },
        {
          "id": "48",
          "name": "Greater Manchester",
          "__typename": "Region"
        },
        {
          "id": "49",
          "name": "Lancashire",
          "__typename": "Region"
        },
        {
          "id": "50",
          "name": "Merseyside",
          "__typename": "Region"
        }
      ],
      "__typename": "Region"
    },
    {
      "id": "51",
      "name": "East of England",
      "subdivisions": [
        {
          "id": "52",
          "name": "East Anglia",
          "__typename": "Region"
        },
        {
          "id": "53",
          "name": "Bedfordshire and Hertfordshire",
          "__typename": "Region"
        },
        {
          "id": "54",
          "name": "Essex",
          "__typename": "Region"
        }
      ],
      "__typename": "Region"
    },
    {
      "id": "55",
      "name": "West Midlands",
      "subdivisions": [
        {
          "id": "56",
          "name": "Herefordshire, Worcestershire and Warwickshire",
          "__typename": "Region"
        },
        {
          "id": "57",
          "name": "Shropshire and Staffordshire",
          "__typename": "Region"
        },
        {
          "id": "58",
          "name": "West Midlands",
          "__typename": "Region"
        }
      ],
      "__typename": "Region"
    },
    {
      "id": "59",
      "name": "South West England",
      "subdivisions": [
        {
          "id": "60",
          "name": "Gloucestershire, Wiltshire and Bristol/Bath area",
          "__typename": "Region"
        },
        {
          "id": "61",
          "name": "Dorset and Somerset",
          "__typename": "Region"
        },
        {
          "id": "62",
          "name": "Cornwall and Isles of Scilly",
          "__typename": "Region"
        },
        {
          "id": "63",
          "name": "Devon",
          "__typename": "Region"
        }
      ],
      "__typename": "Region"
    },
    {
      "id": "64",
      "name": "Yorkshire and the Humber",
      "subdivisions": [
        {
          "id": "65",
          "name": "East Riding and North Lincolnshire",
          "__typename": "Region"
        },
        {
          "id": "66",
          "name": "North Yorkshire",
          "__typename": "Region"
        },
        {
          "id": "67",
          "name": "South Yorkshire",
          "__typename": "Region"
        },
        {
          "id": "68",
          "name": "West Yorkshire",
          "__typename": "Region"
        }
      ],
      "__typename": "Region"
    },
    {
      "id": "69",
      "name": "East Midlands",
      "subdivisions": [
        {
          "id": "70",
          "name": "Derbyshire and Nottinghamshire",
          "__typename": "Region"
        },
        {
          "id": "71",
          "name": "Leicestershire, Rutland and Northamptonshire",
          "__typename": "Region"
        },
        {
          "id": "72",
          "name": "Lincolnshire",
          "__typename": "Region"
        }
      ],
      "__typename": "Region"
    },
    {
      "id": "73",
      "name": "North East England",
      "subdivisions": [
        {
          "id": "74",
          "name": "Tees Valley and County Durham",
          "__typename": "Region"
        },
        {
          "id": "75",
          "name": "Northumberland and Tyne and Wear",
          "__typename": "Region"
        }
      ],
      "__typename": "Region"
    }
  ]
  </code></pre>