Now that we have covered the optimization of stylesheets, let's look at our scripts. JavaScript has also had a history of being dropped onto the page without any forethought or planning, and in general has led to bad reputation for the language. But again, because of the complex nature of web applications, the open source community has helped shape the language.
Throughout the book, we have adopted several industry standards, including namespaces, closures, caching variables, and so on. However, it is also essential we validate and profile our scripts so they can be optimized. In this section, we will go through this and hopefully cover the major points needed to make high-performance mobile applications.