How to make our own JavaScript library | SoloLearn: Learn to code for FREE!


How to make our own JavaScript library

Help me

11/20/2020 8:29:59 AM


2 Answers

New Answer


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 You can watch this vid to know more and have a practical example..