// 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
You can track a JavaScript object by using Getters and Setters as described here,
http://ejohn.org/blog/javascript-getters-and-setters/
You can also look at,
Javascript getters and setters for dummies?