js对象构造方法

    xiaoxiao2021-03-25  122


    第一种 var Car = function() { this.wheels = 4; this.engines = 1; this.seats = 1; };第二种 var Car = function(wheels, seats, engines) { this.wheels = wheels; this.seats = seats; this.engines = engines; };第三种 var car = { “wheels”:4, “engines”:1, “seats”:5 };
    转载请注明原文地址: https://ju.6miu.com/read-20237.html

    最新回复(0)