Reputation: 8134
I have this variable in NodeJS:
var toWatch = {
count: 3,
name: {
first: "Foo",
last: "Bar"
}
}
And I want to fire a function when any value of it changes. For example, toWatch.name.first = "ABC"
and toWatch.newProperty = 123
would both trigger this function.
How can I implement this function?
Upvotes: 1
Views: 3306