Solución
solution.tsTypeScript
function groupByLength(words: string[]): Record<number, string[]> {
// Escribe tu solución aquí
// return words.reduce((acc, current)=>{
// const size = current.length
// if (!acc[size]) {
// acc[size] = [];
// }
// acc[size].push(current);
// return acc
// },{} as Record<number, string[]>);
return Object.groupBy(words, word => word.length)
}
// No modificar: necesario para evaluar el resultado.
export { groupByLength };0respuestas