In JS, this function, capitalized in the first letter, is as follows:
function Person(){//};
Can be called a "constructor",
In a class, for example: (PHP, for example)
class Man extends Person{ public function __construct() { // } }
__construct()Also called a "constructor",
What's the difference between these two are called "constructors"?
Reply content:
In JS, this function, capitalized in the first letter, is as follows:
function Person(){//};
Can be called a "constructor",
In a class, for example: (PHP, for example)
class Man extends Person{ public function __construct() { // } }
__construct()Also called a "constructor",
What's the difference between these two are called "constructors"?
Syntax, say PHP also supports the class name function is the construction method, double underline is php5.3 introduced, previously did not support