T 안에 있는 프로퍼티를 바꿀 수 있게 하는(readonly가 아닌) 타입인 Mutable<T>를 구현하라
Implement the generic Mutable<T> which makes all properties in T mutable (not readonly).
type Mutable<T extends object> = {
-readonly [R in keyof T]:T[R]
}
-readonly 키워드를 아는지 확인하는 문제이다
T가 object가 아니면 에러를 던져야하는 요구사항을 위해 T에 extends object 제한을 두었다
다른 사람의 풀이도 비슷했다.
readonly와 ?를 '+'나 '-'를 이용하여 제거/추가할 수 있다.
https://www.typescriptlang.org/docs/handbook/2/mapped-types.html#mapping-modifiers