How to Create Your Own JavaScript Library with Modules (Import/Export)

preview_player
Показать описание
In today's video I'll show you how easy it is to create your own JavaScript utility library using ES6 modules and the import/export syntax.

You can use this library to store helper functions for DOM manipulation, string manipulation, array manipulation, math etc.

For your reference, check this out:

If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!

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

Your Tutorials brings us to a whole new stage
🤯🤯

ahmedb.r
Автор

I like the fact that you kept it simple.

muwagamicheal
Автор

Browser throws an error when the type module is added

kalahari
Автор

thank you. i've been dyin' tyin' to figure this out.

abriefreverie
Автор

What about a module1 file that contains lets say "export let" type of global variables? Is it possible to import that module1 into module2 and change the values of those variables inside this module2 file? Thanks.

andreisavitski
Автор

how can we easily publish this? and use it conviniently while updating

imohanreddy
Автор

How's browser support for this though?

onecornflower
Автор

how to see the console, is it using xampp

codingiseasy
Автор

Please create tutorial how to create JS SDK

azeemhassanch
Автор

hey pro where can i find js gif to pdf library

toursincasablanca
Автор

yeah man, I like short tutorials like this keep the fire burning plus +1 sub

akabayiawalterabdullah
Автор

Thank you,

I was using an abstract class like below in Svelte Project using Typescript and I can call the method like UtilClass.isFloat(n):

export abstract class UtilClass {
public static isFloat(n){
return Number(n) === n && n % 1 !== 0;
}

}

What would be the advantage of using this module export approach of yours?

rodlu
Автор

is there any point on rewriting export function twice on utility file (at min 2:00 on video) ?

elchinjafarli
Автор

I did the same but Chrome and Firefox said: "Access to script at from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, isolated-app, chrome-extension, chrome, https, chrome-untrusted." Any idea on how to bypass this?

sunnie
Автор

Thanks :), can you please upload your code to github ?

greekplayback