Question Bank

JavaScript Tooling and Build Trivia

Difficulty: Easy

Three quick-fire build-pipeline questions: transpiler vs polyfill, Babel vs SWC, and what source maps actually do.

Question Bank
/

JavaScript Tooling and Build Trivia

JavaScript Tooling and Build Trivia

Three quick-fire build-pipeline questions: transpiler vs polyfill, Babel vs SWC, and what source maps actually do.

Question Bank
Easy
JavaScript
3 questions
quiz
js-language
interview-prep
fundamentals

1,028 views

30

Explain the difference between a transpiler (e.g. Babel) and a polyfill. Give one concrete example of each.

Examples

Example 1:

Input: target browser doesn't understand class syntax or Array.prototype.includes
Output: Babel transpiles `class` to constructor functions; core-js polyfills `Array.prototype.includes` at runtime.
Explanation: A transpiler rewrites syntax; a polyfill adds missing runtime APIs.