JavaScript新语-(影印版)

节选

[

  《JavaScript新语(影印版)》:  The preceding construct is either a named function expression or a function dec-laration. The former produces a function, the latter creates a variable and assigns afunction to it (details on both kinds of function definition: “Defining Functions”on page 166).  In order to prevent ambiguity during parsing, JavaScript does not let you use objectliterals and function expressions as statements. That is, expression statements must notstart with:  A curly brace  The keyword function  If an expression starts with either of those tokens, it can only appear in an expressioncontext. You can comply with that requirement by, for example, putting parenthesesaround the expression. Next, we’ll look at two examples where that is necessary.Evaluating an object literal via evalOeval. parses its argument in statement context. You have to put parentheses around anobject literal if you want eval. to return an obiect.  ……

]

内容简介

[

  无论你是否喜欢,JavaScript已经无处不在一一从浏览器到服务器再到移动终端——而现在对于你而言,也需要学习这门语言或者掌握更深的知识。《JavaScript新语(影印版)》将指导你进入JavaScript的世界。它由编程老手撰写,他也曾经经历过相同的阶段。  《JavaScript新语(影印版)》将通过四个独立章节来帮助你掌握JavaScript。首先是快速指南,为你讲解足够的知识以帮助你在正确的道路上前行。而更多有经验的JaVaScript编程人员则能在《JavaScript新语(影印版)》中找到全面和易于阅读的深入涵盖各个语言特性的参者知识。

]

目录

PrefacePart Ⅰ. JavaScript Quick Start1. Basic JavaScriptBackgroundSyntaxVariables and AssignmentValuesBooleansNumbersOperatorsStringsStatementsFunctionsException HandlingStrict ModeVariable Scoping and ClosuresObjects and ConstructorsArraysRegular ExpressionsMathOther Functionality of the Standard LibraryPart Ⅱ. Background2. Why JavaScript?Is JavaScript Freely Available?Is JavaScript Elegant?Is JavaScript Useful?Does JavaScript Have Good Tools?Is JavaScript Fast Enough?Is JavaScript Widely Used?Does JavaScript Have a Future?Conclusion3. The Nature oflavaScriptQuirks and Unorthodox FeaturesElegant PartsInfluences4. How JavaScript Was Created5. Standardization: ECMAScript6. HistoricaIJavaScript MilestonesPartⅢ. JavaScriptin Depth7. JavaScript’s SyntaxAn Overview of the SyntaxCommentsExpressions Versus StatementsControl Flow Statements and BlocksRules for Using SemicolonsLegal IdentifiersInvoking Methods on Number LiteralsStrict Mode8. ValuesJavaScript’s Type SystemPrimitive Values Versus ObjectsPrimitive ValuesObjectsundefined and nullWrapper Objects for PrimitivesType Coercion9. OperatorsOperators and ObjectsAssignment OperatorsEquality Operators: === Versus =Ordering OperatorsThe Plus Operator (+)Operators for Booleans and NumbersSpecial OperatorsCategorizing Values via typeof and instanceofObject Operators10. BooleansConverting to BooleanLogical OperatorsEquality Operators, Ordering OperatorsThe Function Boolean11. NumbersNumber LiteralsConverting to NumberSpecial Number ValuesThe Internal Representation of NumbersHandling Rounding ErrorsIntegers in JavaScriptConverting to IntegerArithmetic OperatorsBitwise OperatorsThe Function NumberNumber Constructor PropertiesNumber Prototype MethodsFunctions for NumbersSources for This Chapter12. StringsString LiteralsEscaping in String LiteralsCharacter AccessConverting to StringComparing StringsConcatenating StringsThe Function StringString Constructor MethodString Instance Property lengthString Prototype Methods13. StatementsDeclaring and Assigning VariablesThe Bodies of Loops and ConditionalsLoopsConditionalsThe with StatementThe debugger Statement14. Exception HandlingWhat Is Exception Handling?Exception Handling in ]avaScriptError ConstructorsStack TracesImplementing Your Own Error Constructor15. FunctionsThe Three Roles of Functions in JavaScriptTerminology: “Parameter” Versus ‘~Argument”Defining FunctionsHoistingThe Name of a FunctionWhich Is Better: A Function Declaration or a Function Expression?More Control over Function Calls: call(), apply(), and bind()Handling Missing or Extra ParametersNamed Parameters16. Variables: Scopes, Environments, and ClosuresDeclaring a VariableBackground: Static Versus DynamicBackground: The Scope of a VariableVariables Are Function-ScopedVariable Declarations Are HoistedIntroducing a New Scope via an IIFEGlobal VariablesThe Global ObjectEnvironments: Managing VariablesClosures: Functions Stay Connected to Their Birth Scopes17. Objects and InheritanceLayer 1: Single ObjectsConverting Any Value to an Objectthis as an Implicit Parameter of Functions and MethodsLayer 2: The Prototype Relationship Between ObjectsIteration and Detection of PropertiesBest Practices: Iterating over Own PropertiesAccessors (Getters and Setters)Property Attributes and Property DescriptorsProtecting ObjectsLayer 3: Constructors——Factories for InstancesData in Prototype PropertiesKeeping Data PrivateLayer 4: Inheritance Between ConstructorsMethods of All ObjectsGeneric Methods: Borrowing Methods from PrototypesPitfalls: Using an Object as a MapCheat Sheet: Working with Objects18. ArraysOverviewCreating ArraysArray IndiceslengthHoles in ArraysArray Constructor MethodArray Prototype MethodsAdding and Removing Elements (Destructive)Sorting and Reversing Elements (Destructive)Concatenating, Slicing, Joining (Nondestructive)Searching for Values (Nondestructive)Iteration (Nondestructive)Pitfall: Array-Like ObjectsBest Practices: Iterating over Arrays19. Regular ExpressionsRegular Expression SyntaxUnicode and Regular ExpressionsCreating a Regular ExpressionRegExp.prototype.test: Is There a Match?String.prototype.search: At What Index Is There a Match?RegExp.prototype.exec: Capture GroupsString.prototype.match: Capture Groups or Return All Matching SubstringsString.prototype.replace: Search and ReplaceProblems with the Flag/gTips and TricksRegular Expression Cheat Sheet20. DatesThe Date ConstructorDate Constructor MethodsDate Prototype MethodsDate Time FormatsTime Values: Dates as Milliseconds Since 1970-01-0121. MathMath PropertiesNumerical FunctionsTrigonometric FunctionsOther Functions22. JSONBackgroundJSON.stringify(value, replacer?, space?)JSON.parse(text, reviver?)Transforming Data via Node Visitors23. Standard Global VariablesConstructorsError ConstructorsNonconstructor FunctionsDynamically Evaluating JavaScript Code via eval0 and new Function()The Console APINamespaces and Special Values24. Unicode and lavaScriptUnicode HistoryImportant Unicode ConceptsCode PointsUnicode EncodingsJavaScript Source Code and UnicodeJavaScript Strings and UnicodeJavaScript Regular Expressions and Unicode25. New in ECMAScript 5New FeaturesSyntactic ChangesNew Functionality in the Standard LibraryTips for Working with Legacy BrowsersPart Ⅳ. Tips, Tools, and Libraries26. A Meta Code Style GuideExisting Style GuidesGeneral TipsCommonly Accepted Best PracticesControversial RulesConclusion27. Language Mechanisms for Debugging28. Subclassing Built-insTerminologyObstacle 1: Instances with Internal PropertiesObstacle 2: A Constructor That Can’t Be Called as a FunctionAnother Solution: Delegation29. JSDoc: Generating API DocumentationThe Basics of JSDocBasic TagsDocumenting Functions and MethodsInline Type Information (”Inline Doc Comments”)Documenting Variables, Parameters, and Instance PropertiesDocumenting ClassesOther Useful Tags30. LibrariesShims Versus PolyfillsFour Language LibrariesThe ECMAScript Internationalization APIDirectories for JavaScript Resources31. Module Systems and Package ManagersModule SystemsPackage ManagersQuick and Dirty Modules32. More Tools33. What to Do NextIndex

封面

JavaScript新语-(影印版)

书名:JavaScript新语-(影印版)

作者:劳施迈耶

页数:437

定价:¥84.0

出版社:东南大学出版社

出版日期:2015-02-01

ISBN:9787564153892

PDF电子书大小:61MB 高清扫描完整版



本文标题:《JavaScript新语-(影印版)》PDF下载

资源仅供学习参考,禁止用于商业用途,请在下载后24小时内删除!