如何检测阵列中的同一座城市? [关闭]

如何检测具有相同城市的物体?

  const products = [
{
  "id": 1,
  "name": "George",
  "delivery": [{
    "city": "Rio de Janeiro",
    "phone": "982892919",
  }],
},
{
  "id": 1,
  "name": "George",
  "delivery": [{
    "city": "São Paulo",
    "phone": "982892919",
  }],
},
{
  "id": 1,
  "name": "George",
  "delivery": [{
    "city": "Rio de Janeiro",
    "phone": "982892919",
  }],
}]

我尝试使用.filter,但无法访问这些值..

评论