What is the difference between importScripts and ES6 / import modules?

I am currently implementing an interface with a service employee. Since I need several pieces of code for my service worker, I decided to use the importScripts function from the standard one.

I really don't understand why importScripts was added to this standard, since modules became part of the ES6 standard about 3 years ago (although most browsers are still missing if the flag is not used).

Can someone clarify this? I assume this is related to error handling, etc ...

+4
source share
1 answer

, importScripts , ES6. - ES6 . Chrome Canary, ES6 front-end 60.

+6

Source: https://habr.com/ru/post/1680701/


All Articles