I have an object which is declared as following (it has as value a global variable):
var example = {
"foo": window.bar
}
Steps after other method is executed and this value change, but if I want to use the value in the object, this is undefined
.
The listeners seem to be exclusively to DOM elements but not to values, There is a way to bind the value at the object to a variable or something that update the value in the object?
here a example what I want to achieve: https://jsfiddle.net/ptbqqk6o/2
Thanks in advance