hi so i followed this question : Convert Array to Object: but apparently there are great answers but not what i require.
I have an array like this : ["123","jhon","doe","hawaii"]
What i want to be able to do is make an object that looks like this :
{id:"123",fname:"jhon",lname:"doe",location:"hawaii"}
Basically i want to assign the values of the array to fix keys for each value. I tried looping over them but that would replace the current object key if i do something like.
let obj = {}
arr.map(val=>{
obj.id = val
})
This will obviously not work. Any ideas or can you point me in the right direction would also help thank you.