Hola a todos estoy recibiendo el siguiente error
Error: Array.prototype.sort() expects a value to be returned at the end of arrow function array-callback-returnel código que está causando este error está debajo
filteredData.sort((a, b) => { if (a.distance !== undefined) { let aValue = parseFloat(a.distance.split(' mi')[0]) let bValue = parseFloat(b.distance.split(' mi')[0]) if (aValue !== undefined && bValue !== undefined) { return aValue > bValue ? 1 : -1 } } else { return 1 } })¿Alguien puede decirme qué estoy haciendo mal?