+ 18
How to make our own JavaScript library
Help me
3 odpowiedzi
+ 12
First you have to know abt functions and why we use library
While writing js.. On bigger projects we see some repetations of code unnecessary...
To overcome that we use functions...
Like everytime we write document.querySelector(xyz)
Instead we can make a function like
function $(query) {
return document.querySelector(query)
}
And eyery time we can say $(xyz)
Instead of typing whole
Now we need to do this all the time
What if we put this function and deploy it somewhere like github
Then we can import all this using a link
Bingo... Youve created tour first lib
https://youtu.be/24GF5MVEEjE
You can watch this vid to know more and have a practical example..
- 1
loom q