资源描述:
《[JavaScript.Enlightenment(2012.12)].Cody.Lindley.文字版》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、JavaScriptEnlightenmentCodyLindleyJavaScriptEnlightenmentbyCodyLindleyCopyright©2013CodyLindley.Allrightsreserved.PrintedintheUnitedStatesofAmerica.PublishedbyO’ReillyMedia,Inc.,1005GravensteinHighwayNorth,Sebastopol,CA95472.O’Reillybooksmaybepurchasedforeducational,business,or
2、salespromotionaluse.Onlineeditionsarealsoavailableformosttitles(http://my.safaribooksonline.com).Formoreinformation,contactourcorporate/institutionalsalesdepartment:800-998-9938orcorporate@oreilly.com.Editors:SimonSt.LaurentandMeghanBlanchetteProofreader:BIMProofreadingServices
3、ProductionEditor:KristenBorgIndexer:EllenTroutmanZaigCoverDesigner:RandyComerInteriorDesigner:DavidFutatoJanuary2013:FirstEditionRevisionHistoryfortheFirstEdition:2012-12-18FirstreleaseSeehttp://oreilly.com/catalog/errata.csp?isbn=9781449342883forreleasedetails.NutshellHandbook
4、,theNutshellHandbooklogo,andtheO’ReillylogoareregisteredtrademarksofO’ReillyMedia,Inc.JavaScriptEnlightenment,theimageofaEurasianeagleowl,andrelatedtradedressaretrade‐marksofO’ReillyMedia,Inc.Manyofthedesignationsusedbymanufacturersandsellerstodistinguishtheirproductsareclaimed
5、astrademarks.Wherethosedesignationsappearinthisbook,andO’ReillyMedia,Inc.,wasawareofatrade‐markclaim,thedesignationshavebeenprintedincapsorinitialcaps.Whileeveryprecautionhasbeentakeninthepreparationofthisbook,thepublisherandauthorassumenoresponsibilityforerrorsoromissions,orfo
6、rdamagesresultingfromtheuseoftheinformationcontainedherein.ISBN:978-1-449-34288-3[LSI]TableofContentsPreface.......................................................................ix1.JavaScriptObjects...........................................................1CreatingObjects1Ja
7、vaScriptConstructorsConstructandReturnObjectInstances6TheJavaScriptNative/Built-InObjectConstructors8User-Defined/Non-NativeObjectConstructorFunctions9InstantiatingConstructorsUsingthenewOperator10CreatingShorthand/LiteralValuesfromConstructors12Primitive(a.k.a.Simple)Values13T
8、hePrimitiveValuesnull,undefined,“string”,10,true,andfa