【发布时间】:2022-08-16 02:10:06
【问题描述】:
所以我试图让我的代码打印出一条返回“这是来自美国的鲍勃·马丁”的消息。
这就是我到目前为止所做的。我一直试图弄清楚出了什么问题,但似乎无法使其正常工作。我提供了 cmets 来指导我的思维过程
function printBio(user) {
// function to print message, user is the object and parameter for my function
// User object that possesses properties as displayed
let user = {
name: \'Bob\',
surname: \'Martin\',
age: 25,
address: \'\',
country: \"USA\"
}
}
return \'This is \' + user.name + \' \' + user.surname + \' from \' + user.country + \'.\';
// My attempt for a return statement to print my desired message
printBio();
// The last step, which is to simply have the function do its job and print the message according to the return statement
}
-
console.log(printBio()) -
似乎您拨打了 printBio();返回后的函数内部,这不起作用
-
代码编辑器按钮是您的朋友
[<>],它打开了一个充满可能性的世界,比如清晰的代码。
标签: javascript object composite complex-data-types