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
constobj={x: 1,};obj.x=3;// OKobj.x='3';// ~ Type 'string' is not assignable to type 'number'obj.y=4;// ~ Property 'y' does not exist on type '{ x: number; }'obj.z=5;// ~ Property 'z' does not exist on type '{ x: number; }'obj.name='Pythagoras';// ~~~~ Property 'name' does not exist on type '{ x: number; }'
constcapitals3: Record<string,Point>=capitals2;capitals3.pr;// undefined at runtime// ^? Pointcapitals2.pr;// ~~ Property 'pr' does not exist on type '{ ny: ...; ca: ...; }'
constcapitalsBad={ny: [-73.7562,42.6526,148],// ~~ Type '[number, number, number]' is not assignable to type 'Point'.ca: [-121.4944,38.5816,26],// ~~ Type '[number, number, number]' is not assignable to type 'Point'.}satisfiesRecord<string,Point>;