Sort by nested-nested where parent has type


(Thomas Bolander) #1

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: [
     
    ]
  }
]

(system) #2

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