SOURCE

function displayInfo(args) {
  var output = "";
  if (typeOf args.name == "string") {
    output += "Name: " + args.name + "\n";
  }
  if (typeOf args.age == "number") {
    output += "Age: " + args.age + "\n";
  }
  // alert(output);
  console.log(output);
}

displayInfo({
  name: "Bobi",
  age: 29
});
console 命令行工具 X clear

                    
>
console