????21. pieces.push(format(num?? consider[i]));

????22. }

????23. }

????24.

????25. humanized = (pieces.length == 1 ? pieces[0] :

????26. pieces.slice(0?? pieces.length - 1).join("?? ") + " and " +

????27. pieces[pieces.length - 1]);

????28. }

????29.

????30. return future ? "in " + humanized : humanized + " ago";

????31. };

??????????????jQuery??????????????????????????????????????????????????????????????????????????????jQuery????????????????????

????????????

????TDD????У???????????????????????????????????????ζ???????????е?????????JsTestDriver???????????е????????????????о???????????????????????????JsTestDriver????????????????????????????в????????????????????TDD???????????????????

???????δ?????????????????棬??????????????????????????TDD??????????????

?????Щ??????????????????????????????????????????????????????????TDD?????(And I mean slow.Slow ruins the TDD flow.)

??????????????????????????????ɡ??????????????????????в?????????????????????e????????Щ???????JsLint???????????e??????в????

???????????????(CI)????????????????п???????????????????????????????????????????????в?????????????CI???????????汾??????????????Git??Subversion???????????????????????????????????????????

???????д???JsTestDriver????Hudson CI?????????????Hudson??JsTestDriver????????????????Ч???????????????????????????????????????????TDD??????????????Firefox?????в???????????????к?????????????????????????????????????????????С????????????????С??????Hudson??????????仯?????????????????????е????????????в??????????????????????????????????????????????????Hudson??????????????????????????????????????

???????????????????

??????????????????????????????????????????????????????????????????????????Щ???????

????????????????jQuery???????????????????????

????Ajax????jQuery?????????????????????????????????????????????£???Щ??????????????????Щ?????DOM?????????????JavaScript????????????Щ????У?????????????????????????????????????????

????????????????????????????????

????????????????????????д????????????????????????????????磬?????????????????????????????????????????????????????????????????????????????????????(???????????????)?У???????????????????????°??????????????д???????????????????????????????????

???????κ?????????????????????????????????“????”????????????????????????????????????????????????(?治????????ests consistlargely of dirt simple statements that exercise your code and make assumptionsabout it.)???????????????????????????????????????仰?????????????????????????д??????????????????????????????κ??????????????

??????????????????????д???????

???????????????????????????????????????С?“????”????????/??TDD????????????????????????????TDD???????????????????κο?????????а?????С????????ó????????????????????????????????????????????????????????????????????????????????????????????д??????????????Щ????????????????????????????????????????????

???????????????

????????????????????????????????????????????ò???????????????????????о???????о??????????????????????????????????????????????????????????????(I do think thatunit testing is an integral part of that equation.)

????????TDD???????????????????????????????TDD????????????????????????????????????????????????????????????Щ????????????????????????????????????????????????????????TDD??????????????

???????????????!

????About the Author

????Originallya student in informatics?? mathematics?? and digital signal processing?? ChristianJohansen has spent his professional career specializing in web and front-enddevelopment with technologies such as JavaScript?? CSS?? and HTML using agilepractices. A frequent open source contributor?? he blogs about JavaScript?? Ruby??and web development at cjohansen.no. Christian works at Gitorious.org?? an open source Git hosting service.

????Find Christianon:

????§ Twitter - @cjno

????§ Christian'sBlog

????§ Christian's Book - Test-Driven JavaScriptDevelopment

????????????????????????????????????????????????????????????????

???????????http://msdn.microsoft.com/en-us/magazine/gg655487.aspx