function test(name, birth_year, current_year) {
const age = current_year - birth_year;
const response = name + " is " + age;
return response;
}
test("bob", 1954, 2015)
function test(name, birth_year, current_year) {
const age = current_year - birth_year;
const response = name + " is " + age;
return response;
}
test("bob", 1954, 2015)
// 函数 test(参数1.参数2,参数3)
function test(name, birth_year, current_year) {
const age = current_year - birth_year;
const response = name + " is " + age;
return response;
}
test("bob", 1954, 2015)
// 调用函数test(传入值1,传入值2,传入值3)=>function test(name="bob", birth_year=1954, current_year=2015) {
const age = current_year - birth_year; // age = 2015 - 1954 = 61
const response = name + " is " + age; // response = bob +" is "+61 = bob is 61 // 拼接
return response; // 返回结果 response 的值
}
希望可以帮助到你!