I was looking at the responses to the question at Removing backslashes from strings in javascript and found that both the responses work,
string.replace(/\\\//g, "/");
and
str = str.replace(/\\/g, '');
Could someone please explain the difference between these two and which would be a better choice?