What is the Record type?
@lebyy▲ 0 net votes
Problem: What does Record<K, T> mean in Typescript? Typescript 2.1 introduced the Record type, describing it in an example: // For every properties K of type T, transform it to U function mapObject<K extends string, T, U>(obj: Record<K see Typescript 2.1 And the… Fix (from the top answer): Can someone give a simple definition of what Record is? A Record<K, T> is an object type whose property keys are K and whose property values are T . That is, keyof Record<K, T> is equivalent to K , and Record<K, T>[K] is (basically) equivalent to T . Is Record<K,T> merely a way of saying "all properties on this…