javascript add prototype method to all functions?
- by salmane
Is there a way to add a method to all javascript functions without using the prototype library?
something along the lines of :
Function.prototype.methodName = function(){
return dowhateverto(this)
};
this is what i tried so far but it didnt work. Perhaps it is a bad idea also if so could you please tell me why?
if so can I add it to a set of functions i choose
something like :
MyFunctions.prototype.methodName = function(){
return dowhateverto(this)
};
where MyFunctions is an array of function names
thank you