Im building a "Diagnostic" view in my JS based app.
I load all of the localstorage in to a variable:
var diagnosticinformation = localStorage;
And then the idea is that I can output diagnosticinformation in to a text box:
textarea1.value = JSON.stringify(diagnosticinformation);
This all works fine.
However, before outputting the diagnosticinformation I would like to hide userToken and sharedpasscode for security purposes.
diagnosticinformation['userToken']="HIDDEN";
diagnosticinformation['sharedpasscode']="HIDDEN";
However, when i do this, the LocalStorage element is then also updated so userToken then become "HIDDEN" and the sharedpasscode also becomes "HIDDEN" in the actual localstorage of the browser, not just within diagnosticinformation
Does anyone know why this is happening?
Surely if object1 = object2 - I can alter object1 without it affecting object2 - however this isn't the case.