Last active
September 8, 2023 03:10
-
-
Save edezekiel/1d566bae9ca4c48de90ae22a5d1c1d95 to your computer and use it in GitHub Desktop.
Demonstrating an error when you assign a string interface to a number index signature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Hero { name: string; } | |
const hero: Hero = { name: 'codey' }; | |
const generic: { [key: number]: any } = hero; // Error |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment