You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeScript doesn't have a concept to support write-only properties in the same way it supports readonly properties. It treats properties with a setter as read/writable.
This can lead to bugs if you try to read the value of the property as it will always yield undefined but TypeScript infers another type.
constobj=newclass{setprop(v: any){}}console.log(obj.prop);// error hereobj.prop++;// error here, calls setter with NaN