Reading this document https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp
"When using the constructor function, the normal string escape rules (preceding special characters with \ when included in a string) are necessary."
So why is there no difference between these two uses of RegExp()?
"a/b/c".match(new RegExp("\/", "g")) // (2) [ "/", "/" ]
"a/b/c".match(new RegExp("/", "g")) // (2) [ "/", "/" ]
Is the document incorrect or am I missing something?
The possible duplicate question indicates that forward slashes must be escaped as literals. Using a string, the example above shows this is not the case given the use case of a string with the constructor function. This question is specifically about using a string with the constructor function.
So based on the answer below, the difference appears to be with literals, both the " and the / need to be escaped, but when using a string only the " needs to be escaped.