📅  最后修改于: 2022-03-11 15:04:01.553000             🧑  作者: Mango
var hello = "Hello, ";
function greet(names) {
if (name == null) {
console.log(hello + "my friend")
} else if (name == name.toUpperCase()) {
console.log(hello.toUpperCase() + name.toUpperCase())
} else {
console.log(hello + name);
}
}
var names = ["jack", "john"]
greet(names);
Run code snippetHide results