function helloGeneric<**T**>(message: **T**): **T** {
	return message
}

helloGeneric<string>('Lee')
helloGeneric<>('Lee')  // T가 인수에 의해서 알아서 추론됨

Generic Array

function helloArray<T>(message: **T[]**): T {
	return message[0]
}

Generic Tuple

function helloTuple<T, K>(message: [T, K]): T {
	return message[0]  // T 타입이 반환된다.
}

Generic의 상속

class PersonExtends<**T extends string | number**> {
	private _name: T
	
	constructor(name: T) {
		this._name = name
	}
}

new PersonExtends('Lee')
new PersonExtends(39)
new PersonExtends(true)  // string or number가 아니므로 오류

keyof

function prop<T, **K extends keyof T**>(obj: T, key: K, value: T[K]): void {
	obj[key] = value
}