Answers for "typescript convert readonly"

1

typescript convert readonly

type DeepWriteable<T> = { -readonly [P in keyof T]: DeepWriteable<T[P]> };
Posted by: Guest on October-21-2021
0

typescript readonly

class Octopus {  readonly name: string;  readonly numberOfLegs: number = 8;
  constructor(theName: string) {    this.name = theName;  }}
let dad = new Octopus("Man with the 8 strong legs");dad.name = "Man with the 3-piece suit";Cannot assign to 'name' because it is a read-only property.2540Cannot assign to 'name' because it is a read-only property.Try
Posted by: Guest on June-29-2021

Code answers related to "TypeScript"

Browse Popular Code Answers by Language