Sort by nested-nested where parent has type

How do i sort these people by attributes.values.value where attribute.type is "score"??
I really can't figure it out. My data structure :

[
  {
    name: "Thomas Bolander",
    attributes: [
      {
        type: "score",
        values: [{value: 2},{value: 5}]
      },
      {
        type: "weight",
        values: [{value: 80}]
      }
    ]
  },
  {
    name: "Kristian Vassard",
    attributes: [
      {
        type: "score",
        values: [{value: 7}, {value: 8 }]
      },
      {
        type: "age",
        values: [{value: 18}]
      }
    ]
  },
  {
    name: "Rune Sønderby",
    attributes: [
      {
        type: "score",
        values: [{value: 1}]
      }
    ]
  },
  {
    name: "Ronnie Faust",
    attributes: [
     
    ]
  }
]

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.