Implement a Polyfill for Deep Object Extension and Merging
Write a polyfill for jQuery-style $.extend() or lodash's _.merge() that deep-merges two or more source objects into a target object. Later sources should override earlier ones for scalar values, but nested objects should be recursively merged rather than replaced. Handle edge cases like merging arrays vs objects, null/undefined sources, and circular references. This is the backbone of configuration merging, default settings, and plugin APIs.