今日学习 构造函数

        function Animal(name, type, barkWay) {
            this.name = name;
            this.type = type;
            this.bark = barkWay;
        }

//首字母大写

//        var dog = new Animal("大黄","BYD",function () {
//            console.log("汪汪汪");
//        });
//        console.log(dog);

//要使用new来创建一个新的

猜你喜欢

转载自blog.csdn.net/qq_38674970/article/details/81368567