We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"extends", "type and interface"
version all
https://www.typescriptlang.org/play?ts=5.4.2#code/C4TwDgpgBAKu0F4oG8BQUNQIYC4oDsBXAWwCMIAnVAX1VQEt9hKAzLAY2gEknWPo0mbHiJlKNOqEhQAglCRxpEAB7N8AEwDOUAEoR2AewrqAPJuAVGAcwA0BEuQoA+KAH4oFwtDxsANpugAekDPCFQpaAAheSgeZgo2TigVNS1dfSNTc0t8W3sxZzcPCi8oHyx-IMC-ANQgA
type Type = { a: number } interface Interface { a: number } type A = Type extends Record<string, number> ? true : false //true type B = Interface extends Record<string, number> ? true : false //false
type A is true type B is false
both true or false
No response
The text was updated successfully, but these errors were encountered:
I can't find any document about the difference about this.
Sorry, something went wrong.
Duplicate of #42825. See also #15300 (comment).
Used search terms: interface type record in:title
interface type record in:title
No branches or pull requests
π Search Terms
"extends", "type and interface"
π Version & Regression Information
version all
β― Playground Link
https://www.typescriptlang.org/play?ts=5.4.2#code/C4TwDgpgBAKu0F4oG8BQUNQIYC4oDsBXAWwCMIAnVAX1VQEt9hKAzLAY2gEknWPo0mbHiJlKNOqEhQAglCRxpEAB7N8AEwDOUAEoR2AewrqAPJuAVGAcwA0BEuQoA+KAH4oFwtDxsANpugAekDPCFQpaAAheSgeZgo2TigVNS1dfSNTc0t8W3sxZzcPCi8oHyx-IMC-ANQgA
π» Code
π Actual behavior
type A is true
type B is false
π Expected behavior
both true or false
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: