Over that time the way in which we use it has evolved greatly. What started as tiny scripts that changed images on mouseover has given way to huge web apps that make many offline applications obsolete.
This evolution is evident even among the unchanged features of the language. For example our treatment of closures has changed dramatically over the years, as can be seen in the way one book wrote about them.
This is an important point. Of course older editions of the book do not cover features introduced in EcmaScript 5, and newer ones do not devote an entire section to
"Arrays in [Netscape] Navigator 2.0". But closures have been the same since day one. This makes them an excellent candidate for chronological comparison.
You would think that since closures never changed, neither did the book's treatment of them. But in fact there was great change.
This isn't because the language changed. It is because the way we use the language changed.
Closures in The Definitive Guide
With help from Toronto Public Library, I put together a timeline of closure coverage across various editions of Mr. Flanagan's book:
|1997||Not a word.|
|2006||A large section, shared with function scope. It contains extensive examples of closures.|
|2011||A large section, dedicated to closures alone. Many other parts of the book demonstrate programming techniques that make use of closures, referring back to this section.|
It is most striking to visually compare the index entries for closures across various editions:
Why this is
If you just run simple onclick scripts, you never run into closures. To run into them, you need a function that creates and returns another function. This is a useful, but advanced programming technique. You are unlikely to need it until you are writing a complex web app. That's why questions about closures are popular in job interviews. They are a good proxy for
In 2002 only a handful did. (I think Outlook Web Access for Internet Explorer 5, released in 1999 along with the necessary XMLHttpRequest technology, may have been the first true "Web 2.0" app.)
I hope Mr. Flanagan is working on the next edition. Although I think his coverage of closures is already maxed out.