If you have a variable set with sensitive data:
var secretPassword = 'myPa$sW0rd';
and you overwrite it:
secretPassword = '0000000000';
Does a javascript engine allocate new memory for the new data? is the data myPa$sW0rd potentially somewhere in unallocated memory still? My main question is this: is there a way to guarantee that you overwrite the data? (ie zero it out or securely delete the data). I wonder if looping through the characters in the string and resetting them that way would do it.
I assume it's not likely you would be able to access the data without some bug in the javascript engine.