JSFiddle - React, Tailwind, and code Playground

JavaScript

var path = "#users/god",
    backslash = String.fromCharCode(92),
    newPath = path.replace(\\/\\/, backslash);

document.write("old: " + path);
document.write("<br>");
document.write("new: " + newPath);