cf.completefrontend

Write the codeMedium

Write MyReadonly<T>, and its opposite, Mutable<T>, which removes readonly.

MyReadonly<T> works like the built-in Readonly<T>. TypeScript has no built-in Mutable<T>: it should remove readonly from every property, and turn a readonly array or tuple into a mutable one.

Write this
type MyReadonly<T> = T; // every property readonlytype Mutable<T> = T; // no property readonly // MyReadonly<{ name: string }>          // { readonly name: string }// Mutable<{ readonly name: string }>    // { name: string }// Mutable<readonly string[]>            // string[]

Solve it in the editor

The answer

Write it yourself first. Then compare it with a reference solution and the checks it passes.

Checking your sign-in…