How do I import an object from a library?

  • 0
    Installed the smoothscroll-polyfiill library
    The documentation says to import 'import smoothscroll from' smoothscroll-polyfill ';'. It seems that everything is clear and understandable, but I have ES5 syntax according to the TK, and modularity in IIFE.
    How can I import this object into IIFE function?
    JavaScript Anonymous, Mar 30, 2020

  • 1 Answers
  • 0
    Build in IIFE, for example via Rollup . Or just a second connection file.

    <script src="a.js"></script>
    <script src="b.js"></script>
    Violet Cameron

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!