I am struggling with an object that I need to have keys representing every item in the array, each linked to a value of any
. Can anyone provide guidance on how to achieve this?
Unfortunately, I couldn't find a solution.
Here is an example for reference:
const arr = [100, 4, 200, 1,2]
const obj = {
100:xx,
4:xx,
1:xx,
2:xx
}
This is what I am trying to achieve. Thank you for your help.