JavaScript Snippet: Max N
- This snippet returns the 'n' largest elements from a list. If 'n' is greater than or equal to the list’s length, then it will return the original list (sorted in descending order).
Jan 13, 2022 · 8:37 AM UTC
1
1
3