Course · Section 9: Data Structures, Modern Operators and Strings · Lecture 111: The Spread Operator (...)
A reusable component merges caller props over its defaults, but className should combine rather than replace. Implement `mergeProps(defaults, overrides)` where overrides win for every key, except `className`, which is concatenated (`defaults.className + ' ' + overrides.className`) when both are present.
+ 2 hidden tests run on Submit.
Object spread already implements 'overrides win'. The className field is the exception: when both objects supply one, the two are joined so base and caller classes both apply, matching how component libraries compose classes.
Run your code to see results.