var input = '/string/';
var output = input.replace(/\//g,'');
// requested output = 'string';
What I don’t like about this method is that the double slashes might be considered a comment and ignored by certain browsers, or am I wrong?
It works in my browser, but I can’t test in every browser. Is it a perfectly proper method, or is there a better solution?
What double slashes? The ones in the regexp? Certainly not, unless the browser’s JavaScript parser is totally broken.
Yes.