Manning secrets of the javascript ninja nov 2009
MEAP Edition Manning Early Access Program
Copyright 2009 Manning Publications
For more information on this and other Manning titles go to www.manning.com
Please post comments or corrections to the Author Online forum athttp://www.manning-sandbox.com/forum.jspa?forumID=431
Download at Boykma.Com
Table of Contents
1. Introduction ................................................................................................................... 1 The JavaScript Language ............................................................................................. 2 Writing Cross-Browser Code........................................................................................ 3 Best Practices ............................................................................................................ 5 Summary .................................................................................................................. 6 2. Testing and Debugging.................................................................................................... 7 Debugging Code ........................................................................................................ 7 Test Generation .......................................................................................................... 8 Building a Test Suite ................................................................................................. 10 Asynchronous Testing....................................................................................... 12 Summary ................................................................................................................. 13 3. Functions ..................................................................................................................... 14 Function Definition................................................................................................... 14 Anonymous Functions and Recursion ........................................................................... 15 Functions as Objects ................................................................................................. 17 Storing Functions.............................................................................................. 18 Self-Memoizing Functions .................................................................................. 18 Context ................................................................................................................... 20 Looping .......................................................................................................... 21 Fake Array Methods.......................................................................................... 22 Variable Arguments .................................................................................................. 22 Min/Max Number in an Array ............................................................................. 23 Function Overloading........................................................................................ 23 Function Length ............................................................................................... 24 Function Type .......................................................................................................... 26 Summary ................................................................................................................. 27 4.Closures ...................................................................................................................... 28 How closures work ................................................................................................... 28 Private Variables .............................................................................................. 29 Callbacks and Timers...
Regístrate para leer el documento completo.