Constructor is a special function, mainly used to initialize objects
Usage scenario: The regular {...} syntax allows you to create an object. Constructor can quickly create multiple similar objects
Constructors are technically regular functions
But there are two agreements
1. Their names begin with capital letters
2. They can only be executed by the "new" operator
function Pig(name,age,gender){ this.name=name this.age=age this.gender=gender } const Peppe=new Pig('佩奇','16','男') const George=new Pig('乔治','18','男') const Mum=new Pig('猪妈妈','43','女') const Dad=new Pig('猪爸爸','45','男')