How to use ES6 Modules to separate your javascript into multiple files #shorts

preview_player
Показать описание
A short breakdown of how to use import and exports in javascript es6 modules.

My VSCode Extensions:
- theme: material community high contrast
- fonts: Menlo, Monaco, 'Courier New', monospace
- errors: Error Lens
- extra git help: Git Lens
- tailwind css intellisense
- indent rainbow
- material icon theme
- prettier & eslint
- ES7+ React Snippets

------------

Рекомендации по теме
Комментарии
Автор

Excellent effort for JavaScript community

shafiulAlamShafi
Автор

Keep up brother your vids are so informative

aikb
Автор

I always watch your videos and they are pretty nice 👍!

klevisimeri
Автор

Something I was looking for, thanks a lot

boredomindex
Автор

name = 'wjd'
wwjd = 'what would junkies develop?'

zachb.
Автор

you forgot the *.js* extension in Node is experimental but in browsers it is still necessary to have

hadawardgz
Автор

Can you show an example using traditional HTML JavaScript with modules?

TarekFaham
Автор

shouldn't you be adding .js extension to the importing statement at the file path? or it's not mandatory ?

mohammed.haydar
Автор

Wish JS had the flexibility of Python, it is super easy to import from other files and install libraries in Python, Js make it unnecessarily hard imho

abdultheseekerofknowledge
Автор

And if you export default there is no need to do { MY_NAME } and can do
import wathever from '. /file'
and will execute what you exported by default.

PatalJunior
Автор

How come sometimes we use Curly Braces when importing but in other cases, there are no curly braces?

ers
Автор

Great job you're doing. Beginners can learn a lot watching at your video's.

Now... I know it's a short. But here I'm missing the correct context and the "why" and "when" you can split your code into different files. There is not much value in just showing you can export and import a simple constant. Although I understand your purpose is to show the concept of export/import

doddledev
Автор

But i think we have to add type = module in script tag before using this

gamezone
Автор

Wouldn't you need this to be a web server before you can use js modules?

somebody_
Автор

what's the extention that gives errors next to code?

floydfernandes
Автор

Can you explain when to use { } for imports and when not to?

kingl
Автор

Does this required NODE to run properly?

akotechonline
Автор

What if you have 100s of variables you want to export would you write export before all of 'em ?

ibrahimahmed
Автор

It didn't work for me. Is there any plugin to install it.

islomurodov
Автор

Does it export by value or by reference?

mohdnasir
visit shbcf.ru