I've got basic variable that I'm getting from my api:
nurseListSpeciality.avatar = "srcs[14]"
I want to change srcs[14] into array name, that my object should be like:
nurseListSpeciality:[{avatar: srcs[14]}]
The main problem is that I don't want to execute the reference on the array, but I want to put just a name of it inside my object.
This is why I failed to use eval()
. Eval is trying to get srcs[14]
value and put it into my object. This is not what I want.