Question: Consider the following TypeScript generic function: function combine ( first: T , second: U ) : T | U { return { . . .
Consider the following TypeScript generic function:
function combinefirst: T second: U: T U
return first, second ;
const output combine job: Engineer salary: ;
What is the type of output?
Answers:
object
job: string salary: number
job: string salary: number
T U
Error: Type T is not assignable to type U
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
