The difference between ordinary functions and constructors
In terms of naming rules, constructors generally have the first letter capitalized, while ordinary functions follow the camel case naming method. 3. This inside the function points to the newly created instance of f 4. The default return value is the instance of f
Ordinary function: 1. fn( )
2. No new object will be created inside the calling function
4. The return value is determined by the return statement
The return value of the constructor:
There is a default return value, the newly created Object (instance);
When the return value is added manually (return statement):
1. The return value is the basic data type -->The real return value is the newly created object (instance)
2. Return value It is a complex data type (object) -->The real return value is this object