I am reading the book by Douglas Crockford, and he uses the construct of
Function.method('inherits', function(Parent){
this.prototype=new Parent();
return this;
});
If we leave alone the meaning of it, I simply can't get around the syntax. I try to run it in chrome, and get
Uncaught TypeError: undefined is not a function test3.html:18
(anonymous function)
as also happens with if I try (jsfiddle)
Function.method("test", function () { return "TEST"; });
There seems to be a post which says this line is working, but I can't make it work. Why can it be?