The following code:

```
var r = /^[0-9A-Z]$/.test;
r("A")

```

Throws 'TypeError: can't convert undefined to object'

How else could I assign the test function to a variable, for passing in functions, later evaluation, etc.? (Without wrapping the regex in another function)

Update:

Consider this bit of valid code before answering:

```
var o = { f: function() { return 1 } };
var a = o.f;
var b = a();     // b = 1

```