I'm trying to sort the data from an array, from the minor to the largest one. and I get the error: `time.sort` is not a function, `time.sort` is `undefined`.

Here is my code:

```
{
    this.state.measure.map((data, index) => {
        let time = data.duration
        const totalTime = time.sort((a, b) => parseFloat(a.time) - parseFloat(b.time))
        console.log(totalTime)
    })
}

```

If I console.log(time) I receive 15:00, 12:00, 50:00, 15:10 that is the data that I want to sort, but first I need to convert to numbers using parseFloat() and later use to order, anyway, this is not the problem.
Looks like that the `sort()` is the problem in my code.
This is my JSON.

```
{
  "measures": [
    {
      "_id": "5fb56d5e734b7e04b9c97c9d",
      "creationDate": "18/11/2020",
      "startTime": "10:00",
      "duration": "15:00",
      "voltage": "220V",
      "avgPower": "34W",
      "maxPower": "7200W",
      "WaterConsumption": "30",
      "avgTemperature": "42",
      "maxTemperature": "48",
      "shower": "5fb56ce7734b7e04b9c97c9b",
      "__v": 0,
      "id": "5fb56d5e734b7e04b9c97c9d"
    },
  ]
}

```

I have three objects like this one and I just want to order them from the smaller to the largest one.

I tried to change the code to

```
{this.state.measure.map((data, index)=> {
    let time = parseFloat(data.duration)
    console.log(time)
})}

```

Now I receive 15, 12, 50, 17.1