QA
Senior LevelJavaScript & TypeScript

What is the TC39 proposal process and how do Babel/SWC polyfill modern JS features?

❓ Interview Prompt: Explain the 5 stages of TC39 ECMAScript proposals (Stage 0-4), syntax transformations, and runtime polyfills.

ECMAScript language features are designed and standardized by the TC39 Technical Committee through a formal 5-stage proposal lifecycle:

TC39 Proposal Stages:

•
Stage 0 (Strawman): Initial submission idea.
•
Stage 1 (Proposal): Formal problem statement and high-level API design.
•
Stage 2 (Draft): Precise spec syntax language defined.
•
Stage 3 (Candidate): Specification complete; requires implementation in browsers and build tools.
•
Stage 4 (Finished): Feature approved for inclusion in the annual ECMAScript release.

Transpilers (Babel/SWC) vs Polyfills (core-js):

•
Transpilation: Converts newer syntax (e.g. ?., ??, arrow functions) to older JS syntax.
•
Polyfilling: Supplies missing runtime objects/methods (e.g. Promise, Array.prototype.includes, structuredClone).

Code Implementation Example

javascript
// Target environment config (.babelrc or swc)
// {
//   "presets": [
//     ["@babel/preset-env", {
//       "useBuiltIns": "usage",
//       "corejs": 3,
//       "targets": "> 0.25%, not dead"
//     }]
//   ]
// }

// Core-js automatically injects polyfills only for missing browser features!
import 'core-js/actual/structured-clone';
💡Configuring TC39 feature polyfills via babel preset-env and core-js.
🎯 Interview Key Takeaway

Syntax transformations rewrite code structures; polyfills supply missing runtime global methods for legacy browsers.

#TC39#ECMAScript#Babel#Polyfills#Senior
Back to all JavaScript & TypeScript Questions→

More JavaScript & TypeScript Interview Questions

Beginner LevelJavaScript & TypeScript

What are the differences between var, let, and const in JavaScript?

Beginner LevelJavaScript & TypeScript

What are the JavaScript data types and the difference between primitives and objects?

Beginner LevelJavaScript & TypeScript

What is the difference between == (loose equality) and === (strict equality)?