Function.{ isCallable, isConstructor }
小于 1 分钟
Function.{ isCallable, isConstructor }
模块
类型
interface FunctionConstructor {
isCallable(value: any): boolean;
isConstructor(value: any): boolean;
}
入口点
core-js/proposals/function-is-callable-is-constructor
core-js(-pure)/full/function/is-callable
core-js(-pure)/full/function/is-constructor
示例
示例:
Function.isCallable(null); // => false
Function.isCallable({}); // => false
Function.isCallable(function () {}); // => true
Function.isCallable(() => {}); // => true
Function.isCallable(class {}); // => false
Function.isConstructor(null); // => false
Function.isConstructor({}); // => false
Function.isConstructor(function () {}); // => true
Function.isConstructor(() => {}); // => false
Function.isConstructor(class {}); // => true