Nothing I try works, and non of the millions of questions related to this topic actually asks this very same question.
let userList = {
user1: "tom"
}
for(let i = 0; i < 5; i++) {
userList[[user[i]]] = i
}
Why is this not working?
It keeps giving me the user is not defined
error. Why? Why is it not adding the new property? It works if I do it outside the loop, but not inside. Why?
How can I dynamically add new properties? I wanna add user1/2/3/4/5/ etc.