Complete the code to declare a generic function with two type parameters.
function pair<[1], U>(first: [1], second: U): [[1], U] { return [first, second]; }
Complete the code to create a generic interface with two type parameters.
interface Result<[1], U> { success: boolean; data: [1] | U; }
Fix the error in the generic function declaration with two parameters.
function merge<[1], U>(obj1: [1], obj2: U): [1] & U { return { ...obj1, ...obj2 }; }
Fill both blanks to declare a generic class with two type parameters and a method using them.
class Pair<[1], [2]> { constructor(public first: [1], public second: [2]) {} getPair(): [[1], [2]] { return [this.first, this.second]; } }
Fill all three blanks to create a generic function that takes two parameters and returns an object with keys and values of those types.
function createMap<[1], [2]>(key: [1], value: [2]): { [1]: [2] } { return { [key]: value }; }
