// A simple Javascript Object / String
var object = \"hello\";
// Imagine a button in the DOM, and if it\'s clicked the object value will change
document.getElement
Javascript does not allow you to set programmatic watchpoints/events on arbitrary objects/variables.
You can use encapsulation to hide individual values inside the object from the outside world, allowing them to be modified only through dedicated "setter" functions that have the side-effects you desire.