I don't see any syntactic difference between an ordinary function, and one which behaves like a constructor for a class. So are they the same?
Does this mean that every single function we define has a property named 'prototype' by default?
Yes, every function has a property named prototype by default. The "construction" functionality is provided by the [[Construct]] internal property(invoked by new F()), which is set for every created function(see http://es5.github.io/#x13.2 - creating function objects, p18)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With