【发布时间】:2015-02-22 14:05:14
【问题描述】:
下面,我构建了一个名为 person 的对象,我想将它的名字和姓氏(结合一些字符串)记录到控制台,但它不起作用。如果有人可以帮助我,我会很高兴。先感谢您。
function person(last, first, birth, marriage) {
this.lastName = last;
this.firstName = first;
this.birthDate = birth;
this.married = marriage;
}
var lovely = new person("Doughnut", "Glazed", "7-8-1990", true);
var callPerson = function(){
console.log("Hey " + person.firstName + " " + person.lastName);
}
callPerson(lovely);
【问题讨论】:
-
感谢大家的帮助!
标签: javascript logging properties console