I am trying to declare a variable with the value returned by a function:
var myValue = hot.getSettings();
However, the value of myValue keeps changing when the return value of getSettings() change. How can I define myValue as the current value of the getSettings() function, and save that value in myValue, even if getSettings change?
Your problem it that hot.getSettings(); return a reference not a copy of variable So you just need to clone that variable
try this :
var value = hot.getSettings();
var myValue = $.extend(true, {}, value);
I hope it will help.