Since JavaScript does not yet support setter / getter methods, I would recommend that you think about how you set your variables. One of the working methods:
Array.prototype.setMember = function(index,newValue) { alert("I will perform some action here"); this[index] = newValue; } var myArray = [1,2,3];
I personally am not a big fan of adding new prototyping methods, but in the near future it will simplify refactoring.
Andrew
source share