第11次作业-构造函数创建对象

这个作业属于哪个课程 https://edu.cnblogs.com/campus/sdscfz/SF4
这个作业要求在哪里 https://edu.cnblogs.com/campus/sdscfz/SF4/homework/12964
这个作业的目标 第11次作业-构造函数创建对象
function Stu(name, age, gender, hobby,time) {
    this.name = name;
    this.age = age;
    this.gender = gender;
    this.hobby = hobby;
    this.time = time;
    this.stu2 = function() {
      document.write("大家好,我叫" + this.name + ",今年" + this.age + "岁,是一位" + this.gender + ",我的爱好是" + this.hobby + "。" + "现在的时间是:" + this.time);
    }
  }
  var me = new Stu("许本博", 18, "男", "看动漫","2023年5月16号周二下午六点二十分");
  function stu1() {
      me.stu2();
  }


posted @ 2023-05-16 18:32  czx258  阅读(12)  评论(0编辑  收藏  举报