From the course: JavaScript: Async
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Making async/await code backward compatible with polyfill - JavaScript Tutorial
From the course: JavaScript: Async
Making async/await code backward compatible with polyfill
- [Instructor] The Async and Await construction became part of JavaScript in 2017. And it's supported by all modern browsers. Like Promises, this code won't work on older browsers or on Opera Mini. But the process of making your Async and Await code backward compatible is a bit more complicated than for Promises. Because Async and Await is based on Promises under the hood, it requires a polyfill for Promises to replicate promise syntax on browsers that don't support it. Our code for the Explore California site already includes a reference to this polyfill to make the earlier version of the code, using the promise constructor backwards compatible. But this promise polyfill by itself won't make Async and Await code work on older browsers. That's because the Async and Await construction first has to be transpiled into a Promises construction, using a tool like Babel. Now transpiling is generally part of a tool chain…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.