in the following code:
const styles = {
a: 1,
b: '100%',
c: 'invalid',
} as const
const styleHolder: { a: number, b: string } = styles
const styleHolder2: { a: number, b: string } = {
a: 1,
b: '100%',
c: 'invalid',
}
Why does styleHolder2
throw an error on c
while styleHolder
does not. Is there anything I can do to get the same error on styleHolder?