Skip to content

Instantly share code, notes, and snippets.

@dagda1
Last active March 26, 2022 22:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dagda1/a88f8af394f054c2182cfebd6494836e to your computer and use it in GitHub Desktop.
Save dagda1/a88f8af394f054c2182cfebd6494836e to your computer and use it in GitHub Desktop.
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