Yes! that would work as well. And it results in a better error report:
The error now is on the messages object declaration (where the banana property is missing) as opposed to where we try to access it by key messages[id] ✅
The error message now reads "Property 'bananas' is missing..." even with TypeScript 2.4. ✅
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Yes! that would work as well. And it results in a better error report:
messagesobject declaration (where thebananaproperty is missing) as opposed to where we try to access it by keymessages[id]✅"Property 'bananas' is missing..."even with TypeScript 2.4. ✅