This is quite bizarre, no idea why it happens, but here it is. When I do this:
/^\d+$/.test('16')
it works fine. But when I do something like the following, I get an error
var t = /^\d+$/.test;
t('16');
The error I get is this:
TypeError: Method RegExp.prototype.test called on incompatible receiver [object Window]
I don't know what it has got to do with Window over here....any idea?