here is my string:
var str = \"This is my \\string\";
This is my code:
var replaced = str.replace(\"/\\\\/\", \"\\\\\\\\\")
In case you have multiple instances or the backslash:
str.split(String.fromCharCode(92)).join(String.fromCharCode(92,92))