First, let me define library. A library is a JavaScript file that contains a bunch of functions, and those functions accomplish some useful task for your webpage. It is a collection of ready made functions or code.
As programmers, we should re-use existing code when we can, so that we don’t waste our time writing code that another programmer has already written. This way, we are not wasting our time.