Ask coding questions

← Back to all posts
JavaScript Problem
ia13ru (43)

Is there a function in web javascript that does what require() in node.js does?

Answered by notGilbert (73) [earned 5 cycles]
View Answer
notGilbert (73)

There is ES6 import / export, but it is only supported in some libraries


(not supported for internet explorer)

SixBeeps (5062)

No. If you need to use a third-party library on the client side, you'd provide a URL to the library source code through the script's src attribute.