I have this string variable
iteration = "Toolset\\Iteration 1"
But when I add the string to a JSON.stringify it changes the value adding two more backslashes Toolset\\\\Iteration 1
var data = JSON.stringify([
{
"op": "add",
"path": "/fields/System.IterationPath",
"value": iteration
}
]);
//output: Toolset\\\\Iteration 1
I need the output to be Toolset\\Iteration 1
What is the best way of adding that particular string with 2 backslashes to a JSON variable?
Toolset\\\\Iteration 1