Import and Export in JavaScript | ES6 Modules | The Complete JavaScript Course | Ep.79

preview_player
Показать описание


📖 Chapters
00:00 - Introduction
02:35 - Why do we need to split the code in multiple files?
04:38 - Dummy ways to split the code - Rearranging JS files?
07:07 - How to use "import" and "export" keywords?
08:54 - Resolve error by setting "type = module" in script tag!
10:16 - What is named export in JavaScript?
12:21 - How to rename a variable during import and export in JavaScript?
16:10 - What is default export in JavaScript?
20:38 - Three Different ways to use import and export in JavaScript
31:01 - What happens by setting "type=module"? Learn behind the scene!
43:08 - How does import works behind the scene? Peek inside devtools!
50:02 - Conclusion

Have any doubts? Join this Telegram group and ask your question. You can also share the projects that you make in this group.

Social Media

Music by geoffharvey from Pixabay
Рекомендации по теме
Комментарии
Автор

Summary:
1) Use named exports when you need to export multiple values from a module.
2) Use default exports when a module needs to export a single value or a fallback value.
3) Import named exports using {} and default exports without {}.
4) You can rename imports using the 'as' keyword for better readability or to avoid naming conflicts.

type=module benefits;
1) It enables strict mode automatically.
2) It enables defer automatically.
3) The code goes in the module scope. Which is helpful.
and many more

nobody
Автор

bhai itna detail ma toh koi nahi jata bhai mai bhi 12 fail hu bhai apke liye ek salute hai 👌

HareKrishna
Автор

Itna indepth me kabhi nahi padha sir, maza agya

piyushgupta
Автор

undertood this concept very well....😊😊, dhanyabad

deepend
Автор

Learned lot of new stuff. Thank you!!!

prashant
Автор

thank you sir, you share your all knowledge

jibonislamgame
Автор

(2:57) ser mene link pr jaakar code copy karna chaha lakeen ho nhi raha vo only link 🔗 hi copy hora hai usko vs code me paste kese karu

ParvezKhan-epzg
Автор

Very informative video.
But one doubt at 47:30 of video ki humne to usersData variable import karaya hai sirf dusri file sei lekin us file ki console statement kyu run ho rahi hai?

tusharchawla
Автор

bhaiy apka js course bhut h na frontend k liye yaa thora bhut or khe s bhe knowledge lene pdege, , , , m ne apke playlist complete kr le do s teen bar or ab sbhe topics clear h project m starting m thore problem hote the, fir m ne fir s apka pura js playlist dekhe too or smj aya or project bhe bn ne lge orr abhe project he bna rha hu apse ek bat puchne the react playlist kb s start kru m please tell me bhaiya???

business_ideas
Автор

Sir ab ap js me kaam kr rhe han....Ya Typescript mein kindly
make a video between js and typescript...plz

mualajutt-th
Автор

Sir apne optional chaining ka video ko kyun private kr diya? Sir wo nahi padna tha kya

prashlovessamosa
Автор

Sir mere CORS error aaara hai window me what to do?

rawatshivani
Автор

(39:55) Ser agr hum type = module karte hain or humne jo userdata.js file banayi hai vo kese connect hogi ???

Mere console pr to error bata raha hai

Failed to load resource : the server responded with a status of 404 ( not found )

ParvezKhan-epzg
Автор

first watched codewithharry video. but didn't understand. and then your video! just wow!
maza aa gaya bhai🤎🤎

kasemmuhammad