Get started with core-js CDN

MIT licensed

Core-js is a modular library providing polyfills for ECMAScript features.

Tags:
  • ES5
  • ECMAScript 5
  • ES6
  • ECMAScript 6
  • ES7
  • ECMAScript 7
  • Harmony
  • Strawman
  • Map
  • Set
  • WeakMap
  • WeakSet
  • Dict
  • Promise
  • Symbol
  • Array generics
  • setImmediate
  • partial application
  • Date formatting

Stable version

Copied!

How to start using core-js CDN


// Include core-js library
const coreJs = document.createElement('script');
coreJs.src = 'https://cdn.cdnhub.io/core-js/3.36.0/minified.js';
document.head.appendChild(coreJs);

// Wait for core-js to load before running the example
coreJs.onload = async () => {
  // Define a function that returns a promise
  const fetchData = async (url) => {
    const response = await fetch(url);
    const data = await response.json();
    return data;
  };

  // Use the function to fetch data and log it to the console
  const exampleData = await fetchData('https://jsonplaceholder.typicode.com/todos/1');
  console.log(exampleData);
};
Copied!
Copied!
Copied!

All versions