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 });