Is there a way to add a method to all javascript functions without using the prototype library?
something along the lines of :
Function.prototype.methodN
Try Object.prototype instead:
Object.prototype.methodName = function(){
return dowhateverto(this)
};
But also heed the warning that extending native objects is not always a good idea.
Function.prototype can't really be manipulated reliably in Javascript; it isn't a real object, because Function() constructor needs to return a function, not an object. But, you can't treat it like a normal function either. Its behaviour when you try to access its 'properties' may be undefined and vary between browsers. See also this question.