'Why does the template literal type extend Record<string,any>?
Why does test1 return 1
type test1 = `${number}px` extends Record<string, any> ? 1 : 0; // test1 ==> 1
type test2 = `${number}px` extends object ? 1 : 0; // test2 ==> 0
type test3 = `100px` extends Record<string, any> ? 1 : 0; // test3 ==> 0
type test4 = `100px` extends object ? 1 : 0; // test4 ==> 0
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
