I’m trying to iterate through an object using the for...in
loop to get the values of all its properties and put them inside variables. I’m stumbling on this.
What I would like to do is loop through the object properties, put the value
inside a variable of the same the name as the property
to use on them on another variable
somePromise.then(response => {
for (let property in response) {
property = response[property] // this doesn't work cause reuses the same variable
}
/// I take the value of each property from the loop and pass it down
user.updateInfoFromOldDB(
userID,
nguid,
property1
property2,
property3
property4,
)
...ommited_code
})