I want an array that allow only for the value of 'john' and 'james', both are not required, I tried below interface:
interface User {
name: ['john' | 'james']
}
but it doesn't work for
const user: User = ['john', 'james']
it work only
const user: User = ['john']
const user: User = ['james']
I think I missed something
nameproperty that is required by the interface.