xuanliao
Results
1
comments of
xuanliao
const func = arr => arr.reduce((newArr, item, index) => { newArr[index] = arr.slice(index).filter(f => f > item)?.[0] || -1 return newArr }, []) console.log(func([2,6,3,8,10,9]))