3.
What will be output to the console after the following code is executed? Will any type errors occur?
function greet(name: string): void {
console.log("Hello, " + name);
}
let username: string = "John Doe";
greet(username);
Hello, [object Object]
Hello, null
Hello, undefined
Hello, John Doe
Correct: D
The code will output Hello, John Doe to the console. No type errors will occur because the argument passed to the greet function matches the expected type of string.