Function 使用console.log调用函数
Javascript新手,尝试使用console.log在输出中打印函数Function 使用console.log调用函数,function,return,console.log,Function,Return,Console.log,Javascript新手,尝试使用console.log在输出中打印函数 var shopperObject = { isMale: true, age: 29, firstName: "Dean", lastName: "Wilcoxson", preferredNickName: "Deanoe", birthDate: "07/28/1991", driv
var shopperObject = {
isMale: true,
age: 29,
firstName: "Dean",
lastName: "Wilcoxson",
preferredNickName: "Deanoe",
birthDate: "07/28/1991",
driversLicenseNumber: "E3874612",
groceryList: ["Apples", "Steak", "Milk", "Bread", "Cheddar_Cheese", ],
fullName: function() {
return this.firstName + " " + this.lastName;
}
};
console.log(shopperObject.fullName);
//输出
[函数:全名]试试这个
shopperObject.fullName()
var shopperObject={
伊斯梅尔:是的,
年龄:29,,
名字:“院长”,
姓氏:“威尔科克森”,
首选昵称:“迪阿诺”,
出生日期:“1991年7月28日”,
驾驶员执照号码:“E3874612”,
杂货店店主:[“苹果”、“牛排”、“牛奶”、“面包”、“切达干酪”、],
全名:函数(){
返回this.firstName+“”+this.lastName;
}
};
log(shopperObject.fullName())代码>就是这样!非常感谢你!