JS: Function.prototype
What Is Function.prototype
Function.prototype
is the value of the property key "prototype"
of the function Function
. 〔see Function Object〕
Function.hasOwnProperty("prototype")
Type
Type of Function.prototype
is function object.
typeof Function.prototype === "function"
Function.prototype(args)
is not useful.
It takes any number of arguments, and always return undefined.
// Function.prototype() takes any arg, return undefined console.log(Function.prototype() === undefined); console.log(Function.prototype(3) === undefined); console.log(Function.prototype(3, 4) === undefined); console.log(Function.prototype({}) === undefined);
Parent
Parent of Function.prototype
is Object.prototype
.
Reflect.getPrototypeOf(Function.prototype) === Object.prototype
Purpose
Function.prototype
is the parent of all function objects.
console.log(Reflect.getPrototypeOf(function f() {}) === Function.prototype); console.log(Reflect.getPrototypeOf((x) => 3) === Function.prototype);
Properties
Value Properties
Function Properties
JavaScript, Function
- JS: Define Function
- JS: Arrow Function
- JS: Function Parameters
- JS: arguments Object
- JS: Function Rest Parameters
- JS: Function Argument Default Value
- JS: Function Argument Destructure
- JS: Function Declaration vs Function Expression
- JS: Closure
- JS: Function Call, Apply, Bind
- JS: Functional Programing
- JS: Function Pipe 🚀
- JS: Function Object
- JS: Function Constructor
- JS: Function.prototype