I am trying to parse a string like this
var temp = JSON.parse('{"FHPosition":"consultant","FDesc":"apr4","FHId":"i:0#.w|spdev\gkr"}'.replace("\\","\\\\"))
console.log(temp.FHId)
//expected output: i:0#.w|spdev\gkr
//actual output: i:0#.w|spdevgkr
But when I try to replace backslash or do any actions with string backslash vanishes from a string. Is there any way to replace backslash without it vanishing?