JS

TypeScript Quiz - output typescript code

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