Skip to content

Instantly share code, notes, and snippets.

@dagda1
Last active March 26, 2022 22:21
Embed
What would you like to do?
type Equal<X, Y> = (<T>() => T extends X ? 1 : 2) extends (<T>() => T extends Y ? 1 : 2) ? true : false
type Test1 = Equal<[1, 2, '3'], [1, 2, '3']>
// ^? - type Test1 = true
type Test2 = Equal<[1, 2, '3'], [1, 2, 3]>
// ^? - type Test2 = false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment