Overwrite variable content javascript

后端 未结 2 1208
南笙
南笙 2021-01-27 17:52

If you have a variable set with sensitive data:

var secretPassword = \'myPa$sW0rd\';

and you overwrite it:

secretPassword = \'0         


        
2条回答
  •  滥情空心
    2021-01-27 18:09

    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.

提交回复
热议问题