jskatas.org Continuously Learn JavaScript. Your Way.

Function constructor: Function.prototype

The prototype property of the Function constructor is a Function object.

The Function prototype contains all methods and properties of a function

the specified methods and props
const ownPropertyNames = Object.getOwnPropertyNames(Function.prototype); ['length', 'name', 'constructor', 'apply', 'bind', 'call', 'toString'] .forEach(name => assert(ownPropertyNames.includes(name), `Failed to find "${name}".`));
the old/deprecated/inofficial methods and props
const ownPropertyNames = Object.getOwnPropertyNames(Function.prototype); ['arguments', 'caller'] .forEach(name => assert(ownPropertyNames.includes(name), `Failed to find "${name}".`));

Links

The very first version of the spec defines this property already, the ES1 spec, see section 15.3.4 (PDF 732kB).

Related Katas

function API

Arrow functions

Async Function

Difficulty Level

BEGINNER

Stats

2 tests to solve