Niraj Choubey Niraj Choubey - 1 year ago 87
Javascript Question

value of variable has changed or not

how to find whether a value of variable is changed or not in javascript .

Answer Source


var testVariable = 10;
var oldVar = testVariable;

if (oldVar != testVariable)
alert("testVariable has changed!");

And no, there is no magical "var.hasChanged()" nor "var.modifyDate()" in Javascript unless you code it yourself.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download