After running a website speed test, you may find that one of the Lighthouse report comments will recommend to “Avoid serving legacy JavaScript to modern browsers.” When this message appears, it is because you are using older JavaScript code (ES5 or older) within a modern browser.
What ends up happening is that developers will end up converting, or transpiling, current JavaScript (ES6) down to ES5 to support the users that are using older browser versions. When this happens, it typically increases the size of the JavaScript files that must be downloaded, parsed, executed, etc., by the browser, which in turn causes delays and web page performance issues. The technical term for this process is polyfills or transforms.