📜  text.toUpperCase 不是函数 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:01.553000             🧑  作者: Mango

代码示例1
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