Skip to main content

Function.{ isCallable, isConstructor }

Less than 1 minutefeaturees-proposal

Function.{ isCallable, isConstructor }open in new window

Modules

Types

interface FunctionConstructor {
  isCallable(value: any): boolean;
  isConstructor(value: any): boolean;
}

Entry points

core-js/proposals/function-is-callable-is-constructor
core-js(-pure)/full/function/is-callable
core-js(-pure)/full/function/is-constructor

Example

Exampleopen in new window:

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