I'm trying to join two Array like this:
const param = null
const optionsHeaders: Array<['string', 'string']> = param || []
const sesHeaders = [
['X-SES-CONFIGURATION-SET', 'config-set']
]
const headers: Array<['string', 'string']> = [...optionsHeaders, ...sesHeaders]
console.log(headers)
The result is as expected:
[
[
"X-SES-CONFIGURATION-SET",
"config-set"
]
]
But the TypeScript compiler is complaining:
Type 'string[][]' is not assignable to type '["string", "string"][]'.
Type 'string[]' is missing the following properties from type '["string", "string"]': 0, 1
const headers: Array<['string', 'string']> = [...optionsHeaders, ...sesHeaders]
What am I missing here?
: string= all possible strings,: 'string'= only the string'string'. Yes, values can be types!