1×
Become a member
to unlock all features
Autoplay

    Make Properties and Index Signatures Readonly in TypeScript

    typescriptTypeScript
    ^2.0.0

    TypeScript 2.0 introduced the readonly modifier which can be added to a property or index signature declaration. It helps prevent against unintended property assignments. This lesson gives various use cases for readonly and shows what the generated JavaScript code looks like.