Why do
console.log(/a/ == /a/);
and
var regexp1 = /a/; var regexp2 = /a/; console.log(regexp1 == regexp2);
bo
Just a guess - but doesn't JavaScript create a RegExp object for your regex, and therefore because you have created two different objects (even though they have the same "value") they're actually different?
RegExp