Difference between importing and requiring? #738
Answered
by
krakxn
369-shar-block
asked this question in
Q&A
-
Just confused about what's the main difference between importing and requiring. For example, a lot of times we do this: But we also do this: What's the difference? |
Beta Was this translation helpful? Give feedback.
Answered by
krakxn
Jul 4, 2022
Replies: 1 comment 3 replies
-
We use |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
369-shar-block
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We use
import
for vanilla JavaScript and derivatives; andrequire
is primarily used in Node.js. The use/meaning is the same for both of them though, just different syntax.Hope this helps!