Wait for object to edit

Question:
Wait for object value to edit before reading next line
code snippet

var object = {
  value: 1
}
console.log(object[value])
object.value = 2
console.log(object[value])

// Returns 2 and 2
// I want it to log 1 and then 2

image

1 Like

Ok it works

I accidentally removed the value thing

I did

console.log(object)

Returns 2 and 2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.