I am having problems converting a string to a variable.
- I cannot use an
eval()
because the code is ran through anothereval
- I have no access to
window
.
I have tried running an IIFE function no success
I have tried these stackoverflow answers
How do i convert a string to a variable?
For clarity why
myObject = {
name: 'alexander',
color: 'grey'
}
for (const key of Object.keys(myObject)) {
db.friends.update(2, {
key: "Test data"})
}
A workaround to this could also be helpful.
Could I trim?