Modern JavaScript for the Impatient, 1st edition
BRAND: PEARSON
eBook edition. 1 year Subscription. Dành cho Cá nhân | Trường ĐH, Nhóm, Thư Viện: Gọi 0915920514 để báo giá Pearson, Vital Source eBook hoặc mua Sách In
Tổng quan sách
Ngày nay, JavaScript hoàn toàn khác biệt và mạnh mẽ hơn bao giờ hết. Trong môi trường mà giao diện người dùng ngày càng dựa trên web, nó trở thành “ngôn ngữ chung” của trình duyệt web. Các khung như Electron và các nền tảng như AWS Lambda đang mở rộng sức mạnh của nó hơn nữa. Nếu bạn đang chuyển sang JavaScript, bạn cần học JavaScript hiện đại, nhưng hầu hết các hướng dẫn vẫn tập trung vào các kỹ thuật cũ. Trong JavaScript hiện đại dành cho người thiếu kiên nhẫn, tác giả bán chạy nhất Cay Horstmann đưa ra phần giới thiệu ngắn gọn, đầy đủ và thực tế về các kỹ thuật và công cụ JavaScript ngày nay, đồng thời chỉ ra cách tránh những cạm bẫy trong quá khứ.Horstmann chỉ cho sinh viên cách tận dụng tối đa Thư viện chuẩn, các công cụ JavaScript hiện đại, lập trình web và không đồng bộ, v.v. Học viên sẽ tìm thấy thông tin đặc biệt có giá trị về các chuỗi công cụ và khung công tác, điều này thường gây trở ngại cho những người mới sử dụng JavaScript. Giống như trong Core Java® SE 9 dành cho người thiếu kiên nhẫn, Horstmann trình bày rất nhiều kiến thức cơ bản nhưng anh ấy trình bày các kỹ thuật của mình theo từng phần nhỏ được sắp xếp để truy cập nhanh và dễ hiểu. Đây là JavaScript dành cho các dự án mà học sinh của bạn đang bắt đầu bây giờ – và những dự án mà các em sẽ thấy vào ngày mai.
- Preface xvAbout the Author xxi
- Chapter 1: Values and Variables 11.1 Running JavaScript 11.2 Types and the typeofOperator 51.3 Comments 51.4 Variable Declarations 61.5 Identifiers 71.6 Numbers 81.7 Arithmetic Operators 91.8 Boolean Values 121.9 null and undefined 121.10 String Literals 131.11 Template Literals 151.12 Objects 161.13 Object Literal Syntax 171.14 Arrays 181.15 JSON 201.16 Destructuring 211.17 Advanced Destructuring 23Exercises 24
- Chapter 2: Control Structures 272.1 Expressions and Statements 272.2 Semicolon Insertion 292.3 Branches 312.4 Boolishness 342.5 Comparison and Equality Testing 342.6 Mixed Comparisons 362.7 Boolean Operators 372.8 The switchStatement 392.9 while anddo Loops 402.10 for Loops 412.11 Breaking and Continuing 442.12 Catching Exceptions 46Exercises 47
- Chapter 3: Functions and Functional Programming 513.1 Declaring Functions 513.2 Higher-Order Functions 533.3 Function Literals 543.4 Arrow Functions 543.5 Functional Array Processing 563.6 Closures 573.7 Hard Objects 593.8 Strict Mode 613.9 Testing Argument Types 623.10 Supplying More or Fewer Arguments 633.11 Default Arguments 643.12 Rest Parameters and the Spread Operator 643.13 Simulating Named Arguments with Destructuring 663.14 Hoisting 673.15 Throwing Exceptions 693.16 Catching Exceptions 703.17 The finallyClause 72Exercises 73
- Chapter 4: Object-Oriented Programming 774.1 Methods 774.2 Prototypes 784.3 Constructors 814.4 The Class Syntax 834.5 Getters and Setters 854.6 Instance Fields and Private Methods 854.7 Static Methods and Fields 864.8 Subclasses 874.9 Overriding Methods 894.10 Subclass Construction 904.11 Class Expressions 914.12 The thisReference 92Exercises 95
- Chapter 5: Numbers and Dates 995.1 Number Literals 995.2 Number Formatting 1005.3 Number Parsing 1015.4 Number Functions and Constants 1025.5 Mathematical Functions and Constants 1035.6 Big Integers 1055.7 Constructing Dates 1055.8 Date Functions and Methods 1095.9 Date Formatting 110Exercises 110
- Chapter 6: Strings and Regular Expressions 1156.1 Converting between Strings and Code Point Sequences 1156.2 Substrings 1166.3 Other String Methods 1186.4 Tagged Template Literals 1216.5 Raw Template Literals 1226.6 Regular Expressions 1236.7 Regular Expression Literals 1276.8 Flags 1276.9 Regular Expressions and Unicode 1296.10 The Methods of the RegExpClass 1306.11 Groups 1316.12 String Methods with Regular Expressions 1336.13 More about Regex Replace 1356.14 Exotic Features 136Exercises 137
- Chapter 7: Arrays and Collections 1417.1 Constructing Arrays 1417.2 The lengthProperty and Index Properties 1437.3 Deleting and Adding Elements 1447.4 Other Array Mutators 1457.5 Producing Elements 1487.6 Finding Elements 1497.7 Visiting All Elements 1507.8 Sparse Arrays 1527.9 Reduction 1537.10 Maps 1567.11 Sets 1587.12 Weak Maps and Sets 1597.13 Typed Arrays 1607.14 Array Buffers 163Exercises 164
- Chapter 8: Internationalization 1678.1 The Locale Concept 1678.2 Specifying a Locale 1688.3 Formatting Numbers 1718.4 Localizing Dates and Times 1728.5 Collation 1768.6 Other Locale-Sensitive String Methods 1778.7 Plural Rules and Lists 1788.8 Miscellaneous Locale Features 180Exercises 181
- Chapter 9: Asynchronous Programming 1859.1 Concurrent Tasks in JavaScript 1859.2 Making Promises 1889.3 Immediately Settled Promises 1919.4 Obtaining Promise Results 1919.5 Promise Chaining 1929.6 Rejection Handling 1949.7 Executing Multiple Promises 1969.8 Racing Multiple Promises 1979.9 Async Functions 1979.10 Async Return Values 1999.11 Concurrent Await 2019.12 Exceptions in Async Functions 202Exercises 203
- Chapter 10: Modules 20910.1 The Module Concept 20910.2 ECMAScript Modules 21010.3 Default Imports 21110.4 Named Imports 21210.5 Dynamic Imports 21310.6 Exports 21310.7 Packaging Modules 217Exercises 218
- Chapter 11: Metaprogramming 22111.1 Symbols 22111.2 Customization with Symbol Properties 22311.3 Property Attributes 22511.4 Enumerating Properties 22811.5 Testing a Single Property 22911.6 Protecting Objects 23011.7 Creating or Updating Objects 23111.8 Accessing and Updating the Prototype 23111.9 Cloning Objects 23211.10 Function Properties 23511.11 Binding Arguments and Invoking Methods 23611.12 Proxies 23711.13 The ReflectClass 24011.14 Proxy Invariants 242Exercises 244
- Chapter 12: Iterators and Generators 24912.1 Iterable Values 24912.2 Implementing an Iterable 25012.3 Closeable Iterators 25212.4 Generators 25412.5 Nested Yield 25512.6 Generators as Consumers 25712.7 Generators and Asynchronous Processing 25912.8 Async Generators and Iterators 261Exercises 263
- Chapter 13: An Introduction to Typescript 26913.1 Type Annotations 27013.2 Running TypeScript 27113.3 Type Terminology 27313.4 Primitive Types 27413.5 Composite Types 27513.6 Type Inference 27713.7 Subtypes 28013.8 Classes 28413.9 Structural Typing 28713.10 Interfaces 28813.11 Indexed Properties 29013.12 Complex Function Parameters 29113.13 Generic Programming 297Exercises 305Index 309
