O'Reilly logo

Pro JavaScript for Web Apps by Adam Freeman

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

C H A P T E R  9

Writing Better JavaScript

In this chapter, I explain some of the techniques I use to create better JavaScript. This is not a language guide, and I won’t be demonstrating any code hacks or tweaks. My coding preferences are your maintenance nightmares, and vice versa. I have seen otherwise mild-mannered people end up in a screaming match over the “right” way to code, and I don’t see the point in lecturing you when I have a fair few bad habits myself.

Instead, I am going to show you some of the techniques I use to make my code easier for other programmers and projects to use. Most large-scale web apps have a team of programmers, and sharing code becomes important.

I have been dumping useful functions into the utils.js file throughout ...

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