If you have a variable set with sensitive data:
var secretPassword = \'myPa$sW0rd\';
and you overwrite it:
secretPassword = \'0
Try to use an array of fixed size and assign 0 values to all elements on clean-up. This does not reallocate a new object.
However, it will be difficult to control where the value is passed around once you use it as a string.