Node.js · Junior · Question 19 of 75

What does import() (with parentheses) do?

Explanation

Dynamic import() works in both CommonJS and ESM. It is useful for loading code on demand or importing an ES module from CommonJS.

Further reading

Problem with a question

Node.js · Junior · question 19

Test yourself

Take the Node.js · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz