内容简介
InordertotrulymasterJavaScript,youneedtolearnhowtoworkeffectivelywiththelanguage’sflexible,expressivefeaturesandhowtoavoiditspitfalls.Nomatterhowlongyou’vebeenwritingJavaScriptcode,EffectiveJavaScriptwillhelpdeepenyourunderstandingofthispowerfullanguage,soyoucanbuildmorepredictable,reliable,andmaintainableprograms.AuthorDavidHerman,withhisyearsofexperienceonEcma’sJavaScriptstandardizationcommittee,illuminatesthelanguage’sinnerworkingsasneverbefore—helpingyoutakefulladvantageofJavaScript’sexpressiveness.ReflectingthelatestversionsoftheJavaScriptstandard,thebookofferswell-proventechniquesandbestpracticesyou’llrelyonforyearstocome.EffectiveJavaScriptisorganizedaround68provenapproachesforwritingbetterJavaScript,backedbyconcreteexamples.You’lllearnhowtochoosetherightprogrammingstyleforeachproject,manageunanticipatedproblems,andworkmoresuccessfullywitheveryfacetofJavaScriptprogrammingfromdatastructurestoconcurrency.KeyfeaturesincludeBetterwaystouseprototype-basedobject-orientedprogrammingSubtletiesandsolutionsforworkingwitharraysanddictionaryobjectsPreciseandpracticalexplanationsofJavaScript’sfunctionsandvariablescopingsemanticsUsefulJavaScriptprogrammingpatternsandidioms,suchasoptionsobjectsandmethodchainingIn-depthguidanceonusingJavaScript’sunique“run-to-completion”approachtoconcurrency