Returning the position of a number in an array

I have an array of numbers say

let numbers = [4,7,2,0,9];

I want the numbers array to be mapped based on the size of the number in the array and return its position. I need the output to look like this

numbers = [3,4,2,1,5];

thank you



Read more here: https://stackoverflow.com/questions/66278535/returning-the-position-of-a-number-in-an-array

Content Attribution

This content was originally published by david ibitoye at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: