This is now available natively as RegExp.escape(). You can also use this to escape a string that is inserted into the middle of a regex, for example, into a character ...
JavaScript is a great language. It has a simple syntax, large ecosystem and, what is most important, a great community. At the same time, we all know that JavaScript is quite a funny language with ...