1.0 KiB
1.0 KiB
layout, title, description, permalink
| layout | title | description | permalink |
|---|---|---|---|
| docs | FAQ | Frequently Asked Questions and Answers | /docs/faq/ |
Why are there Array.from and Object.assign calls in my code?! These functions don't exist!
This is a known caveat. This is because 6to5 compiles to ES3 syntax but with ES5 and ES6 methods. This is essential to emulate a complete ES6 environment so your code wont break! You see, ES6 features such as iterators and symbols require a lot of logic to work, and to accurately support these it would mean a lot of boilerplate smoshed into your codebase. This is the approach taken by other transpilers but 6to5 approaches it quite differently.
You have two options, depending on your use case:
- Use the wonderful core aliasing optional transformer. This is recommended if you're writing a library.
- Or use the bundled 6to5 polyfill. This is recommended if you're writing an entire application.