Why does `bind`'s returning function have no `prototype` property?

Viewed 42
let f = Array.bind({a:1})
f.prototype === undefined // true
typeof f === 'function' // true

Almost all of JavaScript's functions have a prototype property. I'm wondering what happens in bind. Did it remove prototype?

1 Answers

It's in the official JavaScript spec, ECMAScript 2020:

NOTE 1 Function objects created using Function.prototype.bind are exotic objects. They also do not have a prototype property.

These so-called "bound function exotic objects" are not regular Function objects.

Related