Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
All functions are created from a Function() constructor, even if you do not
directly invoke the Function()
constructor (e.g., var add = new Function('x',
'y', 'return x + z');) and instead use the literal notation
(e.g., var add = function(x,y){return x +
z};).
When a function instance is created, it is always given a prototype property, which is an empty object.
Below, we define a function called myFunction, then we
access the prototype property, which is
simply an empty object.
<!DOCTYPE html><html lang="en"><body><script>
var myFunction = function() {};
console.log(myFunction.prototype); // logs object{}
console.log(typeof myFunction.prototype); // logs 'object'
</script></body></html>