Polyfilling Array.prototype.flat with core-js: A Decision Guide for Legacy Environments
Use core-js 3.23+ to polyfill Array.prototype.flat for deep array flattening in legacy JavaScript. Supports depth control, adds ~1.2 KB gzipped, handles sparse arrays as undefined.