diff --git a/step00d_assignability_error/app.ts b/step00d_assignability_error/app.ts index d0b4b9ed..22d740c3 100644 --- a/step00d_assignability_error/app.ts +++ b/step00d_assignability_error/app.ts @@ -1,4 +1,6 @@ -let message = "Hello World"; -message = 6; -console.log(message); - +//An assignability error in TypeScript occurs when you attempt to assign a value to a variable or property in a way that does not conform to its declared type. + +let myName: string +myName = 22 // Here, trying to assign the number 22 to myName. Since myName is declared to hold only string values, TypeScript throws an assignability error: Type 'number' is not assignable to type 'string' + +console.log(myName);