function Person(name,age,sex){

        this.name = name;
        this.age = age;
        this.sex = sex;
        this.sayHi = function(){
            console.log("hello");
        };
    }

    var p1 = new Person("zs",18,true);

    console.log(p1);

2023-07-05T07:27:20.png