DEV Community

loading...

Discussion on: Daily Challenge #256 - How Many Are Smaller Than I?

Collapse
timon profile image
Timon van Spronsen
function smaller(arr) {
  return arr.map((x, i) => arr.slice(i).filter((y) => y < x).length);
}