📜  javascript 接口类 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:07.729000             🧑  作者: Mango

代码示例1
Object.prototype.can = function(methodName)
{
     return ((typeof this[methodName]) == "function");
};

if (someObject.can("quack"))
{
    someObject.quack();
}