JS

TypeScript Quiz - typescript code problem

13.

Will TypeScript detect a problem with the following code? If so, what's the problem?

function multiply(a: number, b: string): number {
  return a * b;
}

The code has a syntax error.

TypeScript will not detect a problem with this code.

No, there is no problem.

Yes: Type 'string' is not assignable to type 'number'