O'Reilly logo

The JavaScript PocketGuide by Lenny Burdette

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

12. Libraries

Throughout this book you’ve seen helper functions for strings, arrays, elements, and events. You may want to use these or similar functions in your code. And when you start your second project, you may decide to copy much of this code over so you don’t have to start from scratch. Ta-da! You’ve created a library!

The most important reason for using a library is to avoid reinventing the wheel for each project. JavaScript has a relatively small set of built-in functions, so collections of reusable code can be great time-savers.

JavaScript programmers also spend much of their time dealing with the differences between browsers, especially between Internet Explorer and all the other modern browsers like Firefox and Chrome. Sometimes ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required