Last active
September 8, 2023 03:24
-
-
Save edezekiel/bc812a3cf13b7c1c25c0e87dc3fc826f to your computer and use it in GitHub Desktop.
No error when assigning interface to Record<string, any> even without 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; } // Missing the 'string' index signature | |
const hero: Hero = { hero: 'codey' }; | |
const generic: Record<string, any> = hero; // No Error. Why? How? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment