The right way to assign a RegExp to a variable is by using "new", since it's a constructor, but it also works without it, like in this example:
var a = RegExp('abc');
var b = new RegExp('abc');
console.log(a, b, "abcd".match(a), "abcd".match(b), a == b);
output: /abc/ /abc/ Array["abc"] Array["abc"] false
So my question is - do I need to use "new"?
On the other hand a == b fails, so are they different somehow, because their objects look the same?