Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript interface class

Object.prototype.can = function(methodName)
{
     return ((typeof this[methodName]) == "function");
};

if (someObject.can("quack"))
{
    someObject.quack();
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #interface #class
ADD COMMENT
Topic
Name
4+1 =