The amount of times I thought test was a prototype of String instead of RegExp and written:
I can't even nearly count...Code:alert("hi there how are you".test(/hi/))
Code:<script type="text/javascript"> String.prototype.test=function(reg){if("test" in reg)return reg.test(this);return null;} alert("hi there how are you".test(/hi/)) alert(/hi/.test("hi there how are you")) alert("hi there how are you".test(/bye/)) alert(/bye/.test("hi there how are you")) </script>


Reply With Quote
Bookmarks