Skip to main content
Core-JSCore-JS

Core-JS

Use the latest ECMAScript features before they are widely supported

How to Use💡Sponsor🧡

Modularization

On-demand loading and no global namespace pollution

Widely used

Most popular polyfill of the JavaScript. 250 million downloads per month on NPM

Easy to use

Integration with tools like Babel and SWC

Powerful features

Implemented new APIs from ES5 to ongoing ECMAScript proposal

Sponsors

core-js isn't backed by a company, so the future of this project depends on you. Become a sponsor or a backer if you are interested in core-js.

more backers

backersopen in new window

Examples

//https://tinyurl.com/2mknex43
import "core-js/actual";
Promise.resolve(42).then((it) => console.log(it)); // => 42
Array.from(new Set([1, 2, 3]).union(new Set([3, 4, 5]))); // => [1, 2, 3, 4, 5]
[1, 2].flatMap((it) => [it, it]); // => [1, 1, 2, 2]
(function* (i) {
  while (true) yield i++;
})(1)
  .drop(1)
  .take(5)
  .filter((it) => it % 2)
  .map((it) => it ** 2)
  .toArray(); // => [9, 25]
structuredClone(new Set([1, 2, 3])); // => new Set([1, 2, 3])