Skip to content
Advertisement

Get Indeces of list of numbers Top N, next top N, and last top N

Given that I have a list of numbers:

JavaScript

I want to separate it to top N’s three times. Which means I want to rank them.

JavaScript

What I tried:

JavaScript

But this only gives indeces of the topmost and not the next topmost value of the list.

Advertisement

Answer

Use:

JavaScript

Output

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement