I have this Map will all sorts of IDs as keys and, what I would like to know, is how you can get the values of the Map up until some key is passed.
Given that you have a key, for instance '5', I would like to return 0-5 and nothing further than that. Also, keys are not ordered from 0 to infinity, I mean the index of the key in the map if that is possible.
I don't know if Map.entries() is a good use for this problem.
I'll give a little example as an array:
[
"n89w3rn98w3",
"67q2g76gG67",
"vna09wa9WHD",
"g67a3889aIU",
"ADW78aw3a8J",
"89a7h3aIUJ4"
]
Given that the top of the array is index 0 and the last value is index 5. If I have the key "g67a3889aIU" (4th in the array), I would like to get the following returned:
[
"n89w3rn98w3",
"67q2g76gG67",
"vna09wa9WHD",
"g67a3889aIU"
]
Which are the first 4, because it's the 4th I've inputted.
But to clarify, this should be a map, not an array. I was just giving an example.
Thanks