import {Equal} from '@type-challenges/utils';
type StringTuple = [string, ...string[]]; // Tuples also support rest elements
let d: StringTuple = ['a', 'b', 'c'];
let e: StringTuple = ['a', 'b', 'c', 'd', 'e'];
type R = Equal<StringTuple, string[]>; // false
What's the difference between StringTuple and string[]?
Both of them are non-fixed length arrays of strings, but they are not equal.
UPDATE:
Thanks to @Kelvin Schoofs. I got it:
After remove starting string, StringTuple do equals to string[]!
import {Equal} from '@type-challenges/utils';
type StringTuple = [...string[]]; // Tuples also support rest elements
let d: StringTuple = []; // OK!
let e: StringTuple = ['a', 'b', 'c', 'd', 'e'];
type R = Equal<StringTuple, string[]>; // true!