TypeScript · Junior · Question 19 of 75
What does Record<string, number> describe?
- ✓Correct answer: An object whose keys are strings and values are numbers
- 2An array of
[string, number]pairs sorted by key - 3A
Mapcollection from the JavaScript standard library
Explanation
Record<K, V> is an object with keys K and values V. With union keys it requires all of them: Record<'en' | 'uk', string>. It isn't a Map: Map is a separate data structure with get/set methods.