JavaScript Notes for Professionals book

    Amazing collection of free programming books

    收集中
    免费
    Amazing collection of free programming books

    The Notes for Professionals book is compiled from Stack Overflow Documentation, the content is written by the beautiful people at Stack Overflow. Text content is released under Creative Commons BY-SA. See credits at the end of this book whom contributed to the various chapters. Images may be copyright of their respective owners unless otherwise specified

    Book created for educational purposes and is not affiliated with group(s), company(s) nor Stack Overflow. All trademarks belong to their respective company owners

    https://goalkicker.com/

    章节目录

    • 1-1
      Content list
    • 1-2
      About
    • 1-3
      Chapter 1: Getting started with JavaScript
    • 1-4
      Section 1.1: Using console.log()
    • 1-5
      Section 1.2: Using the DOM API
    • 1-6
      Section 1.3: Using window.alert()
    • 1-7
      Section 1.4: Using window.prompt()
    • 1-8
      Section 1.5: Using window.confirm()
    • 1-9
      Section 1.6: Using the DOM API (with graphical text: Canvas, SVG, or image file)
    • 1-10
      Chapter 2: JavaScript Variables
    • 1-11
      Section 2.1: Defining a Variable
    • 1-12
      Section 2.2: Using a Variable
    • 1-13
      Section 2.3: Types of Variables
    • 1-14
      Section 2.4: Arrays and Objects
    • 1-15
      Chapter 3: Built-in Constants
    • 1-16
      Section 3.1: null
    • 1-17
      Section 3.2: Testing for NaN using isNaN()
    • 1-18
      Section 3.3: NaN
    • 1-19
      Section 3.4: undefined and null
    • 1-20
      Section 3.5: Infinity and -Infinity
    • 1-21
      Section 3.6: Number constants
    • 1-22
      Section 3.7: Operations that return NaN
    • 1-23
      Section 3.8: Math library functions that return NaN
    • 1-24
      Chapter 4: Comments
    • 1-25
      Section 4.1: Using Comments
    • 1-26
      Section 4.2: Using HTML comments in JavaScript (Bad practice)
    • 1-27
      Chapter 5: Console
    • 1-28
      Section 5.1: Measuring time - console.time()
    • 1-29
      Section 5.2: Formatting console output
    • 1-30
      Section 5.3: Printing to a browser's debugging console
    • 1-31
      Section 5.4: Including a stack trace when logging - console.trace()
    • 1-32
      Section 5.5: Tabulating values - console.table()
    • 1-33
      Section 5.6: Counting - console.count()
    • 1-34
      Section 5.7: Clearing the console - console.clear()
    • 1-35
      Section 5.8: Displaying objects and XML interactively - console.dir(), console.dirxml()
    • 1-36
      Section 5.9: Debugging with assertions - console.assert()
    • 1-37
      Chapter 6: Datatypes in JavaScript
    • 1-38
      Section 6.1: typeof
    • 1-39
      Section 6.2: Finding an object's class
    • 1-40
      Section 6.3: Getting object type by constructor name
    • 1-41
      Chapter 7: Strings
    • 1-42
      Section 7.1: Basic Info and String Concatenation
    • 1-43
      Section 7.2: Reverse String
    • 1-44
      Section 7.3: Comparing Strings Lexicographically
    • 1-45
      Section 7.4: Access character at index in string
    • 1-46
      Section 7.5: Escaping quotes
    • 1-47
      Section 7.6: Word Counter
    • 1-48
      Section 7.7: Trim whitespace
    • 1-49
      Section 7.8: Splitting a string into an array
    • 1-50
      Section 7.9: Strings are unicode
    • 1-51
      Section 7.10: Detecting a string
    • 1-52
      Section 7.11: Substrings with slice
    • 1-53
      Section 7.12: Character code
    • 1-54
      Section 7.13: String Representations of Numbers
    • 1-55
      Section 7.14: String Find and Replace Functions
    • 1-56
      Section 7.15: Find the index of a substring inside a string
    • 1-57
      Section 7.16: String to Upper Case
    • 1-58
      Section 7.17: String to Lower Case
    • 1-59
      Section 7.18: Repeat a String
    • 1-60
      Chapter 8: Date
    • 1-61
      Section 8.1: Create a new Date object
    • 1-62
      Section 8.2: Convert to a string format
    • 1-63
      Section 8.3: Creating a Date from UTC
    • 1-64
      Section 8.4: Formatting a JavaScript date
    • 1-65
      Section 8.5: Get the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC
    • 1-66
      Section 8.6: Get the current time and date
    • 1-67
      Section 8.7: Increment a Date Object
    • 1-68
      Section 8.8: Convert to JSON
    • 1-69
      Chapter 9: Date Comparison
    • 1-70
      Section 9.1: Comparing Date values
    • 1-71
      Section 9.2: Date Dierence Calculation
    • 1-72
      Chapter 10: Comparison Operations
    • 1-73
      Section 10.1: Abstract equality / inequality and type conversion
    • 1-74
      Section 10.2: NaN Property of the Global Object
    • 1-75
      Section 10.3: Short-circuiting in boolean operators
    • 1-76
      Section 10.4: Null and Undefined
    • 1-77
      Section 10.5: Abstract Equality (==)
    • 1-78
      Section 10.6: Logic Operators with Booleans
    • 1-79
      Section 10.7: Automatic Type Conversions
    • 1-80
      Section 10.8: Logic Operators with Non-boolean values (boolean coercion)
    • 1-81
      Section 10.9: Empty Array
    • 1-82
      Section 10.10: Equality comparison operations
    • 1-83
      Section 10.11: Relational operators (<, <=, >, >=)
    • 1-84
      Section 10.12: Inequality
    • 1-85
      Section 10.13: List of Comparison Operators
    • 1-86
      Section 10.14: Grouping multiple logic statements
    • 1-87
      Section 10.15: Bit fields to optimise comparison of multi state data
    • 1-88
      Chapter 11: Conditions
    • 1-89
      Section 11.1: Ternary operators
    • 1-90
      Section 11.2: Switch statement
    • 1-91
      Section 11.3: If / Else If / Else Control
    • 1-92
      Section 11.4: Strategy
    • 1-93
      Section 11.5: Using || and && short circuiting
    • 1-94
      Chapter 12: Arrays
    • 1-95
      Section 12.1: Converting Array-like Objects to Arrays
    • 1-96
      Section 12.2: Reducing values
    • 1-97
      Section 12.3: Mapping values
    • 1-98
      Section 12.4: Filtering Object Arrays
    • 1-99
      Section 12.5: Sorting Arrays
    • 1-100
      Section 12.6: Iteration
    • 1-101
      Section 12.7: Destructuring an array
    • 1-102
      Section 12.8: Removing duplicate elements
    • 1-103
      Section 12.9: Array comparison
    • 1-104
      Section 12.10: Reversing arrays
    • 1-105
      Section 12.11: Shallow cloning an array
    • 1-106
      Section 12.12: Concatenating Arrays
    • 1-107
      Section 12.13: Merge two array as key value pair
    • 1-108
      Section 12.14: Array spread / rest
    • 1-109
      Section 12.15: Filtering values
    • 1-110
      Section 12.16: Searching an Array
    • 1-111
      Section 12.17: Convert a String to an Array
    • 1-112
      Section 12.18: Removing items from an array
    • 1-113
      Section 12.19: Removing all elements
    • 1-114
      Section 12.20: Finding the minimum or maximum element
    • 1-115
      Section 12.21: Standard array initialization
    • 1-116
      Section 12.22: Joining array elements in a string
    • 1-117
      Section 12.23: Removing/Adding elements using splice()
    • 1-118
      Section 12.24: The entries() method
    • 1-119
      Section 12.25: Remove value from array
    • 1-120
      Section 12.26: Flattening Arrays
    • 1-121
      Section 12.27: Append / Prepend items to Array
    • 1-122
      Section 12.28: Object keys and values to array
    • 1-123
      Section 12.29: Logical connective of values
    • 1-124
      Section 12.30: Checking if an object is an Array
    • 1-125
      Section 12.31: Insert an item into an array at a specific index
    • 1-126
      Section 12.32: Sorting multidimensional array
    • 1-127
      Section 12.33: Test all array items for equality
    • 1-128
      Section 12.34: Copy part of an Array
    • 1-129
      Chapter 13: Objects
    • 1-130
      Section 13.1: Shallow cloning
    • 1-131
      Section 13.2: Object.freeze
    • 1-132
      Section 13.3: Object cloning
    • 1-133
      Section 13.4: Object properties iteration
    • 1-134
      Section 13.5: Object.assign
    • 1-135
      Section 13.6: Object rest/spread (...)
    • 1-136
      Section 13.7: Object.defineProperty
    • 1-137
      Section 13.8: Accesor properties (get and set)
    • 1-138
      Section 13.9: Dynamic / variable property names
    • 1-139
      Section 13.10: Arrays are Objects
    • 1-140
      Section 13.11: Object.seal
    • 1-141
      Section 13.12: Convert object's values to array
    • 1-142
      Section 13.13: Retrieving properties from an object
    • 1-143
      Section 13.14: Read-Only property
    • 1-144
      Section 13.15: Non enumerable property
    • 1-145
      Section 13.16: Lock property description
    • 1-146
      Section 13.17: Object.getOwnPropertyDescriptor
    • 1-147
      Section 13.18: Descriptors and Named Properties
    • 1-148
      Section 13.19: Object.keys
    • 1-149
      Section 13.20: Properties with special characters or reserved words
    • 1-150
      Section 13.21: Creating an Iterable object
    • 1-151
      Section 13.22: Iterating over Object entries - Object.entries()
    • 1-152
      Section 13.23: Object.values()
    • 1-153
      Chapter 14: Arithmetic (Math)
    • 1-154
      Section 14.1: Constants
    • 1-155
      Section 14.2: Remainder / Modulus (%)
    • 1-156
      Section 14.3: Rounding
    • 1-157
      Section 14.4: Trigonometry
    • 1-158
      Section 14.5: Bitwise operators
    • 1-159
      Section 14.6: Incrementing (++)
    • 1-160
      Section 14.7: Exponentiation (Math.pow() or **)
    • 1-161
      Section 14.8: Random Integers and Floats
    • 1-162
      Section 14.9: Addition (+)
    • 1-163
      Section 14.10: Little / Big endian for typed arrays when using bitwise operators
    • 1-164
      Section 14.11: Get Random Between Two Numbers
    • 1-165
      Section 14.12: Simulating events with dierent probabilities
    • 1-166
      Section 14.13: Subtraction (-)
    • 1-167
      Section 14.14: Multiplication (*)
    • 1-168
      Section 14.15: Getting maximum and minimum
    • 1-169
      Section 14.16: Restrict Number to Min/Max Range
    • 1-170
      Section 14.17: Ceiling and Floor
    • 1-171
      Section 14.18: Getting roots of a number
    • 1-172
      Section 14.19: Random with gaussian distribution
    • 1-173
      Section 14.20: Math.atan2 to find direction
    • 1-174
      Section 14.21: Sin & Cos to create a vector given direction & distance
    • 1-175
      Section 14.22: Math.hypot
    • 1-176
      Section 14.23: Periodic functions using Math.sin
    • 1-177
      Section 14.24: Division (/)
    • 1-178
      Section 14.25: Decrementing (--)
    • 1-179
      Chapter 15: Bitwise operators
    • 1-180
      Section 15.1: Bitwise operators
    • 1-181
      Section 15.2: Shift Operators
    • 1-182
      Chapter 16: Constructor functions
    • 1-183
      Section 16.1: Declaring a constructor function
    • 1-184
      Chapter 17: Declarations and Assignments
    • 1-185
      Section 17.1: Modifying constants
    • 1-186
      Section 17.2: Declaring and initializing constants
    • 1-187
      Section 17.3: Declaration
    • 1-188
      Section 17.4: Undefined
    • 1-189
      Section 17.5: Data Types
    • 1-190
      Section 17.6: Mathematic operations and assignment
    • 1-191
      Section 17.7: Assignment
    • 1-192
      Chapter 18: Loops
    • 1-193
      Section 18.1: Standard "for" loops
    • 1-194
      Section 18.2: "for ... of" loop
    • 1-195
      Section 18.3: "for ... in" loop
    • 1-196
      Section 18.4: "while" Loops
    • 1-197
      Section 18.5: "continue" a loop
    • 1-198
      Section 18.6: Break specific nested loops
    • 1-199
      Section 18.7: "do ... while" loop
    • 1-200
      Section 18.8: Break and continue labels
    • 1-201
      Chapter 19: Functions
    • 1-202
      Section 19.1: Function Scoping
    • 1-203
      Section 19.2: Currying
    • 1-204
      Section 19.3: Immediately Invoked Function Expressions
    • 1-205
      Section 19.4: Named Functions
    • 1-206
      Section 19.5: Binding `this` and arguments
    • 1-207
      Section 19.6: Functions with an Unknown Number of Arguments (variadic functions)
    • 1-208
      Section 19.7: Anonymous Function
    • 1-209
      Section 19.8: Default parameters
    • 1-210
      Section 19.9: Call and apply
    • 1-211
      Section 19.10: Partial Application
    • 1-212
      Section 19.11: Passing arguments by reference or value
    • 1-213
      Section 19.12: Function Arguments, "arguments" object, rest and spread parameters
    • 1-214
      Section 19.13: Function Composition
    • 1-215
      Section 19.14: Get the name of a function object
    • 1-216
      Section 19.15: Recursive Function
    • 1-217
      Section 19.16: Using the Return Statement
    • 1-218
      Section 19.17: Functions as a variable
    • 1-219
      Chapter 20: Functional JavaScript
    • 1-220
      Section 20.1: Higher-Order Functions
    • 1-221
      Section 20.2: Identity Monad
    • 1-222
      Section 20.3: Pure Functions
    • 1-223
      Section 20.4: Accepting Functions as Arguments
    • 1-224
      Chapter 21: Prototypes, objects
    • 1-225
      Section 21.1: Creation and initialising Prototype
    • 1-226
      Chapter 22: Classes
    • 1-227
      Section 22.1: Class Constructor
    • 1-228
      Section 22.2: Class Inheritance
    • 1-229
      Section 22.3: Static Methods
    • 1-230
      Section 22.4: Getters and Setters
    • 1-231
      Section 22.5: Private Members
    • 1-232
      Section 22.6: Methods
    • 1-233
      Section 22.7: Dynamic Method Names
    • 1-234
      Section 22.8: Managing Private Data with Classes
    • 1-235
      Section 22.9: Class Name binding
    • 1-236
      Chapter 23: Namespacing
    • 1-237
      Section 23.1: Namespace by direct assignment
    • 1-238
      Section 23.2: Nested Namespaces
    • 1-239
      Chapter 24: Context (this)
    • 1-240
      Section 24.1: this with simple objects
    • 1-241
      Section 24.2: Saving this for use in nested functions / objects
    • 1-242
      Section 24.3: Binding function context
    • 1-243
      Section 24.4: this in constructor functions
    • 1-244
      Chapter 25: Setters and Getters
    • 1-245
      Section 25.1: Defining a Setter/Getter Using Object.defineProperty
    • 1-246
      Section 25.2: Defining an Setter/Getter in a Newly Created Object
    • 1-247
      Section 25.3: Defining getters and setters in ES6 class
    • 1-248
      Chapter 26: Events
    • 1-249
      Section 26.1: Page, DOM and Browser loading
    • 1-250
      Chapter 27: Inheritance
    • 1-251
      Section 27.1: Standard function prototype
    • 1-252
      Section 27.2: Dierence between Object.key and Object.prototype.key
    • 1-253
      Section 27.3: Prototypal inheritance
    • 1-254
      Section 27.4: Pseudo-classical inheritance
    • 1-255
      Section 27.5: Setting an Object's prototype
    • 1-256
      Chapter 28: Method Chaining
    • 1-257
      Section 28.1: Chainable object design and chaining
    • 1-258
      Section 28.2: Method Chaining
    • 1-259
      Chapter 29: Callbacks
    • 1-260
      Section 29.1: Simple Callback Usage Examples
    • 1-261
      Section 29.2: Continuation (synchronous and asynchronous)
    • 1-262
      Section 29.3: What is a callback?
    • 1-263
      Section 29.4: Callbacks and `this`
    • 1-264
      Section 29.5: Callback using Arrow function
    • 1-265
      Section 29.6: Error handling and control-flow branching
    • 1-266
      Chapter 30: Intervals and Timeouts
    • 1-267
      Section 30.1: Recursive setTimeout
    • 1-268
      Section 30.2: Intervals
    • 1-269
      Section 30.3: Intervals
    • 1-270
      Section 30.4: Removing intervals
    • 1-271
      Section 30.5: Removing timeouts
    • 1-272
      Section 30.6: setTimeout, order of operations, clearTimeout
    • 1-273
      Chapter 31: Regular expressions
    • 1-274
      Section 31.1: Creating a RegExp Object
    • 1-275
      Section 31.2: RegExp Flags
    • 1-276
      Section 31.3: Check if string contains pattern using .test()
    • 1-277
      Section 31.4: Matching With .exec()
    • 1-278
      Section 31.5: Using RegExp With Strings
    • 1-279
      Section 31.6: RegExp Groups
    • 1-280
      Section 31.7: Replacing string match with a callback function
    • 1-281
      Section 31.8: Using Regex.exec() with parentheses regex to extract matches of a string
    • 1-282
      Chapter 32: Cookies
    • 1-283
      Section 32.1: Test if cookies are enabled
    • 1-284
      Section 32.2: Adding and Setting Cookies
    • 1-285
      Section 32.3: Reading cookies
    • 1-286
      Section 32.4: Removing cookies
    • 1-287
      Chapter 33: Web Storage
    • 1-288
      Section 33.1: Using localStorage
    • 1-289
      Section 33.2: Simpler way of handling Storage
    • 1-290
      Section 33.3: Storage events
    • 1-291
      Section 33.4: sessionStorage
    • 1-292
      Section 33.5: localStorage length
    • 1-293
      Section 33.6: Error conditions
    • 1-294
      Section 33.7: Clearing storage
    • 1-295
      Section 33.8: Remove Storage Item
    • 1-296
      Chapter 34: Data attributes
    • 1-297
      Section 34.1: Accessing data attributes
    • 1-298
      Chapter 35: JSON
    • 1-299
      Section 35.1: JSON versus JavaScript literals
    • 1-300
      Section 35.2: Parsing with a reviver function
    • 1-301
      Section 35.3: Serializing a value
    • 1-302
      Section 35.4: Serializing and restoring class instances
    • 1-303
      Section 35.5: Serializing with a replacer function
    • 1-304
      Section 35.6: Parsing a simple JSON string
    • 1-305
      Section 35.7: Cyclic object values
    • 1-306
      Chapter 36: AJAX
    • 1-307
      Section 36.1: Sending and Receiving JSON Data via POST
    • 1-308
      Section 36.2: Add an AJAX preloader
    • 1-309
      Section 36.3: Displaying the top JavaScript questions of the month from Stack Overflow's API
    • 1-310
      Section 36.4: Using GET with parameters
    • 1-311
      Section 36.5: Check if a file exists via a HEAD request
    • 1-312
      Section 36.6: Using GET and no parameters
    • 1-313
      Section 36.7: Listening to AJAX events at a global level
    • 1-314
      Chapter 37: Enumerations
    • 1-315
      Section 37.1: Enum definition using Object.freeze()
    • 1-316
      Section 37.2: Alternate definition
    • 1-317
      Section 37.3: Printing an enum variable
    • 1-318
      Section 37.4: Implementing Enums Using Symbols
    • 1-319
      Section 37.5: Automatic Enumeration Value
    • 1-320
      Chapter 38: Map
    • 1-321
      Section 38.1: Creating a Map
    • 1-322
      Section 38.2: Clearing a Map
    • 1-323
      Section 38.3: Removing an element from a Map
    • 1-324
      Section 38.4: Checking if a key exists in a Map
    • 1-325
      Section 38.5: Iterating Maps
    • 1-326
      Section 38.6: Getting and setting elements
    • 1-327
      Section 38.7: Getting the number of elements of a Map
    • 1-328
      Chapter 39: Timestamps
    • 1-329
      Section 39.1: High-resolution timestamps
    • 1-330
      Section 39.2: Get Timestamp in Seconds
    • 1-331
      Section 39.3: Low-resolution timestamps
    • 1-332
      Section 39.4: Support for legacy browsers
    • 1-333
      Chapter 40: Unary Operators
    • 1-334
      Section 40.1: Overview
    • 1-335
      Section 40.2: The typeof operator
    • 1-336
      Section 40.3: The delete operator
    • 1-337
      Section 40.4: The unary plus operator (+)
    • 1-338
      Section 40.5: The void operator
    • 1-339
      Section 40.6: The unary negation operator (-)
    • 1-340
      Section 40.7: The bitwise NOT operator (~)
    • 1-341
      Section 40.8: The logical NOT operator (!)
    • 1-342
      Chapter 41: Generators
    • 1-343
      Section 41.1: Generator Functions
    • 1-344
      Section 41.2: Sending Values to Generator
    • 1-345
      Section 41.3: Delegating to other Generator
    • 1-346
      Section 41.4: Iteration
    • 1-347
      Section 41.5: Async flow with generators
    • 1-348
      Section 41.6: Iterator-Observer interface
    • 1-349
      Chapter 42: Promises
    • 1-350
      Section 42.1: Introduction
    • 1-351
      Section 42.2: Promise chaining
    • 1-352
      Section 42.3: Waiting for multiple concurrent promises
    • 1-353
      Section 42.4: Reduce an array to chained promises
    • 1-354
      Section 42.5: Waiting for the first of multiple concurrent promises
    • 1-355
      Section 42.6: "Promisifying" functions with callbacks
    • 1-356
      Section 42.7: Error Handling
    • 1-357
      Section 42.8: Reconciling synchronous and asynchronous operations
    • 1-358
      Section 42.9: Delay function call
    • 1-359
      Section 42.10: "Promisifying" values
    • 1-360
      Section 42.11: Using ES2017 async/await
    • 1-361
      Section 42.12: Performing cleanup with finally()
    • 1-362
      Section 42.13: forEach with promises
    • 1-363
      Section 42.14: Asynchronous API request
    • 1-364
      Chapter 43: Set
    • 1-365
      Section 43.1: Creating a Set
    • 1-366
      Section 43.2: Adding a value to a Set
    • 1-367
      Section 43.3: Removing value from a set
    • 1-368
      Section 43.4: Checking if a value exist in a set
    • 1-369
      Section 43.5: Clearing a Set
    • 1-370
      Section 43.6: Getting set length
    • 1-371
      Section 43.7: Converting Sets to arrays
    • 1-372
      Section 43.8: Intersection and dierence in Sets
    • 1-373
      Section 43.9: Iterating Sets
    • 1-374
      Chapter 44: Modals - Prompts
    • 1-375
      Section 44.1: About User Prompts
    • 1-376
      Section 44.2: Persistent Prompt Modal
    • 1-377
      Section 44.3: Confirm to Delete element
    • 1-378
      Section 44.4: Usage of alert()
    • 1-379
      Section 44.5: Usage of prompt()
    • 1-380
      Chapter 45: execCommand and contenteditable
    • 1-381
      Section 45.1: Listening to Changes of contenteditable
    • 1-382
      Section 45.2: Getting started
    • 1-383
      Section 45.3: Copy to clipboard from textarea using execCommand("copy")
    • 1-384
      Section 45.4: Formatting
    • 1-385
      Chapter 46: History
    • 1-386
      Section 46.1: history.pushState()
    • 1-387
      Section 46.2: history.replaceState()
    • 1-388
      Section 46.3: Load a specific URL from the history list
    • 1-389
      Chapter 47: Navigator Object
    • 1-390
      Section 47.1: Get some basic browser data and return it as a JSON object
    • 1-391
      Chapter 48: BOM (Browser Object Model)
    • 1-392
      Section 48.1: Introduction
    • 1-393
      Section 48.2: Window Object Properties
    • 1-394
      Section 48.3: Window Object Methods
    • 1-395
      Chapter 49: The Event Loop
    • 1-396
      Section 49.1: The event loop in a web browser
    • 1-397
      Section 49.2: Asynchronous operations and the event loop
    • 1-398
      Chapter 50: Strict mode
    • 1-399
      Section 50.1: For entire scripts
    • 1-400
      Section 50.2: For functions
    • 1-401
      Section 50.3: Changes to properties
    • 1-402
      Section 50.4: Changes to global properties
    • 1-403
      Section 50.5: Duplicate Parameters
    • 1-404
      Section 50.6: Function scoping in strict mode
    • 1-405
      Section 50.7: Behaviour of a function's arguments list
    • 1-406
      Section 50.8: Non-Simple parameter lists
    • 1-407
      Chapter 51: Custom Elements
    • 1-408
      Section 51.1: Extending Native Elements
    • 1-409
      Section 51.2: Registering New Elements
    • 1-410
      Chapter 52: Data Manipulation
    • 1-411
      Section 52.1: Format numbers as money
    • 1-412
      Section 52.2: Extract extension from file name
    • 1-413
      Section 52.3: Set object property given its string name
    • 1-414
      Chapter 53: Binary Data
    • 1-415
      Section 53.1: Getting binary representation of an image file
    • 1-416
      Section 53.2: Converting between Blobs and ArrayBuers
    • 1-417
      Section 53.3: Manipulating ArrayBuers with DataViews
    • 1-418
      Section 53.4: Creating a TypedArray from a Base64 string
    • 1-419
      Section 53.5: Using TypedArrays
    • 1-420
      Section 53.6: Iterating through an arrayBuer
    • 1-421
      Chapter 54: Template Literals
    • 1-422
      Section 54.1: Basic interpolation and multiline strings
    • 1-423
      Section 54.2: Tagged strings
    • 1-424
      Section 54.3: Raw strings
    • 1-425
      Section 54.4: Templating HTML With Template Strings
    • 1-426
      Section 54.5: Introduction
    • 1-427
      Chapter 55: Fetch
    • 1-428
      Section 55.1: Getting JSON data
    • 1-429
      Section 55.2: Set Request Headers
    • 1-430
      Section 55.3: POST Data
    • 1-431
      Section 55.4: Send cookies
    • 1-432
      Section 55.5: GlobalFetch
    • 1-433
      Section 55.6: Using Fetch to Display Questions from the Stack Overflow API
    • 1-434
      Chapter 56: Scope
    • 1-435
      Section 56.1: Closures
    • 1-436
      Section 56.2: Hoisting
    • 1-437
      Section 56.3: Dierence between var and let
    • 1-438
      Section 56.4: Apply and Call syntax and invocation
    • 1-439
      Section 56.5: Arrow function invocation
    • 1-440
      Section 56.6: Bound invocation
    • 1-441
      Section 56.7: Method invocation
    • 1-442
      Section 56.8: Anonymous invocation
    • 1-443
      Section 56.9: Constructor invocation
    • 1-444
      Section 56.10: Using let in loops instead of var (click handlers example)
    • 1-445
      Chapter 57: Modules
    • 1-446
      Section 57.1: Defining a module
    • 1-447
      Section 57.2: Default exports
    • 1-448
      Section 57.3: Importing named members from another module
    • 1-449
      Section 57.4: Importing an entire module
    • 1-450
      Section 57.5: Importing named members with aliases
    • 1-451
      Section 57.6: Importing with side eects
    • 1-452
      Section 57.7: Exporting multiple named members
    • 1-453
      Chapter 58: Screen
    • 1-454
      Section 58.1: Getting the screen resolution
    • 1-455
      Section 58.2: Getting the “available” area of the screen
    • 1-456
      Section 58.3: Page width and height
    • 1-457
      Section 58.4: Window innerWidth and innerHeight Properties
    • 1-458
      Section 58.5: Getting color information about the screen
    • 1-459
      Chapter 59: Variable coercion/conversion
    • 1-460
      Section 59.1: Double Negation (!!x)
    • 1-461
      Section 59.2: Implicit conversion
    • 1-462
      Section 59.3: Converting to boolean
    • 1-463
      Section 59.4: Converting a string to a number
    • 1-464
      Section 59.5: Converting a number to a string
    • 1-465
      Section 59.6: Primitive to Primitive conversion table
    • 1-466
      Section 59.7: Convert an array to a string
    • 1-467
      Section 59.8: Array to String using array methods
    • 1-468
      Section 59.9: Converting a number to a boolean
    • 1-469
      Section 59.10: Converting a string to a boolean
    • 1-470
      Section 59.11: Integer to Float
    • 1-471
      Section 59.12: Float to Integer
    • 1-472
      Section 59.13: Convert string to float
    • 1-473
      Chapter 60: Destructuring assignment
    • 1-474
      Section 60.1: Destructuring Objects
    • 1-475
      Section 60.2: Destructuring function arguments
    • 1-476
      Section 60.3: Nested Destructuring
    • 1-477
      Section 60.4: Destructuring Arrays
    • 1-478
      Section 60.5: Destructuring inside variables
    • 1-479
      Section 60.6: Default Value While Destructuring
    • 1-480
      Section 60.7: Renaming Variables While Destructuring
    • 1-481
      Chapter 61: WebSockets
    • 1-482
      Section 61.1: Working with string messages
    • 1-483
      Section 61.2: Establish a web socket connection
    • 1-484
      Section 61.3: Working with binary messages
    • 1-485
      Section 61.4: Making a secure web socket connection
    • 1-486
      Chapter 62: Arrow Functions
    • 1-487
      Section 62.1: Introduction
    • 1-488
      Section 62.2: Lexical Scoping & Binding (Value of "this")
    • 1-489
      Section 62.3: Arguments Object
    • 1-490
      Section 62.4: Implicit Return
    • 1-491
      Section 62.5: Arrow functions as a constructor
    • 1-492
      Section 62.6: Explicit Return
    • 1-493
      Chapter 63: Workers
    • 1-494
      Section 63.1: Web Worker
    • 1-495
      Section 63.2: A simple service worker
    • 1-496
      Section 63.3: Register a service worker
    • 1-497
      Section 63.4: Communicating with a Web Worker
    • 1-498
      Section 63.5: Terminate a worker
    • 1-499
      Section 63.6: Populating your cache
    • 1-500
      Section 63.7: Dedicated Workers and Shared Workers
    • 1-501
      Chapter 64: requestAnimationFrame
    • 1-502
      Section 64.1: Use requestAnimationFrame to fade in element
    • 1-503
      Section 64.2: Keeping Compatibility
    • 1-504
      Section 64.3: Cancelling an Animation
    • 1-505
      Chapter 65: Creational Design Patterns
    • 1-506
      Section 65.1: Factory Functions
    • 1-507
      Section 65.2: Factory with Composition
    • 1-508
      Section 65.3: Module and Revealing Module Patterns
    • 1-509
      Section 65.4: Prototype Pattern
    • 1-510
      Section 65.5: Singleton Pattern
    • 1-511
      Section 65.6: Abstract Factory Pattern
    • 1-512
      Chapter 66: Detecting browser
    • 1-513
      Section 66.1: Feature Detection Method
    • 1-514
      Section 66.2: User Agent Detection
    • 1-515
      Section 66.3: Library Method
    • 1-516
      Chapter 67: Symbols
    • 1-517
      Section 67.1: Basics of symbol primitive type
    • 1-518
      Section 67.2: Using Symbol.for() to create global, shared symbols
    • 1-519
      Section 67.3: Converting a symbol into a string
    • 1-520
      Chapter 68: Transpiling
    • 1-521
      Section 68.1: Introduction to Transpiling
    • 1-522
      Section 68.2: Start using ES6/7 with Babel
    • 1-523
      Chapter 69: Automatic Semicolon Insertion - ASI
    • 1-524
      Section 69.1: Avoid semicolon insertion on return statements
    • 1-525
      Section 69.2: Rules of Automatic Semicolon Insertion
    • 1-526
      Section 69.3: Statements aected by automatic semicolon insertion
    • 1-527
      Chapter 70: Localization
    • 1-528
      Section 70.1: Number formatting
    • 1-529
      Section 70.2: Currency formatting
    • 1-530
      Section 70.3: Date and time formatting
    • 1-531
      Chapter 71: Geolocation
    • 1-532
      Section 71.1: Get updates when a user's location changes
    • 1-533
      Section 71.2: Get a user's latitude and longitude
    • 1-534
      Section 71.3: More descriptive error codes
    • 1-535
      Chapter 72: IndexedDB
    • 1-536
      Section 72.1: Opening a database
    • 1-537
      Section 72.2: Adding objects
    • 1-538
      Section 72.3: Retrieving data
    • 1-539
      Section 72.4: Testing for IndexedDB availability
    • 1-540
      Chapter 73: Modularization Techniques
    • 1-541
      Section 73.1: ES6 Modules
    • 1-542
      Section 73.2: Universal Module Definition (UMD)
    • 1-543
      Section 73.3: Immediately invoked function expressions (IIFE)
    • 1-544
      Section 73.4: Asynchronous Module Definition (AMD)
    • 1-545
      Section 73.5: CommonJS - Node.js
    • 1-546
      Chapter 74: Proxy
    • 1-547
      Section 74.1: Proxying property lookup
    • 1-548
      Section 74.2: Very simple proxy (using the set trap)
    • 1-549
      Chapter 75: .postMessage() and MessageEvent
    • 1-550
      Section 75.1: Getting Started
    • 1-551
      Chapter 76: WeakMap
    • 1-552
      Section 76.1: Creating a WeakMap object
    • 1-553
      Section 76.2: Getting a value associated to the key
    • 1-554
      Section 76.3: Assigning a value to the key
    • 1-555
      Section 76.4: Checking if an element with the key exists
    • 1-556
      Section 76.5: Removing an element with the key
    • 1-557
      Section 76.6: Weak reference demo
    • 1-558
      Chapter 77: WeakSet
    • 1-559
      Section 77.1: Creating a WeakSet object
    • 1-560
      Section 77.2: Adding a value
    • 1-561
      Section 77.3: Checking if a value exists
    • 1-562
      Section 77.4: Removing a value
    • 1-563
      Chapter 78: Escape Sequences
    • 1-564
      Section 78.1: Entering special characters in strings and regular expressions
    • 1-565
      Section 78.2: Escape sequence types
    • 1-566
      Chapter 79: Behavioral Design Patterns
    • 1-567
      Section 79.1: Observer pattern
    • 1-568
      Section 79.2: Mediator Pattern
    • 1-569
      Section 79.3: Command
    • 1-570
      Section 79.4: Iterator
    • 1-571
      Chapter 80: Server-sent events
    • 1-572
      Section 80.1: Setting up a basic event stream to the server
    • 1-573
      Section 80.2: Closing an event stream
    • 1-574
      Section 80.3: Binding event listeners to EventSource
    • 1-575
      Chapter 81: Async functions (async/await)
    • 1-576
      Section 81.1: Introduction
    • 1-577
      Section 81.2: Await and operator precedence
    • 1-578
      Section 81.3: Async functions compared to Promises
    • 1-579
      Section 81.4: Looping with async await
    • 1-580
      Section 81.5: Less indentation
    • 1-581
      Section 81.6: Simultaneous async (parallel) operations
    • 1-582
      Chapter 82: Async Iterators
    • 1-583
      Section 82.1: Basics
    • 1-584
      Chapter 83: How to make iterator usable inside async callback function
    • 1-585
      Section 83.1: Erroneous code, can you spot why this usage of key will lead to bugs?
    • 1-586
      Section 83.2: Correct Writing
    • 1-587
      Chapter 84: Tail Call Optimization
    • 1-588
      Section 84.1: What is Tail Call Optimization (TCO)
    • 1-589
      Section 84.2: Recursive loops
    • 1-590
      Chapter 85: Bitwise Operators - Real World Examples (snippets)
    • 1-591
      Section 85.1: Swapping Two Integers with Bitwise XOR (without additional memory allocation)
    • 1-592
      Section 85.2: Faster multiplication or division by powers of 2
    • 1-593
      Section 85.3: Number's Parity Detection with Bitwise AND
    • 1-594
      Chapter 86: Tilde ~
    • 1-595
      Section 86.1: ~ Integer
    • 1-596
      Section 86.2: ~~ Operator
    • 1-597
      Section 86.3: Converting Non-numeric values to Numbers
    • 1-598
      Section 86.4: Shorthands
    • 1-599
      Section 86.5: ~ Decimal
    • 1-600
      Chapter 87: Using JavaScript to get/set CSS custom variables
    • 1-601
      Section 87.1: How to get and set CSS variable property values
    • 1-602
      Chapter 88: Selection API
    • 1-603
      Section 88.1: Get the text of the selection
    • 1-604
      Section 88.2: Deselect everything that is selected
    • 1-605
      Section 88.3: Select the contents of an element
    • 1-606
      Chapter 89: File API, Blobs and FileReaders
    • 1-607
      Section 89.1: Read file as string
    • 1-608
      Section 89.2: Read file as dataURL
    • 1-609
      Section 89.3: Slice a file
    • 1-610
      Section 89.4: Get the properties of the file
    • 1-611
      Section 89.5: Selecting multiple files and restricting file types
    • 1-612
      Section 89.6: Client side csv download using Blob
    • 1-613
      Chapter 90: Notifications API
    • 1-614
      Section 90.1: Requesting Permission to send notifications
    • 1-615
      Section 90.2: Sending Notifications
    • 1-616
      Section 90.3: Closing a notification
    • 1-617
      Section 90.4: Notification events
    • 1-618
      Chapter 91: Vibration API
    • 1-619
      Section 91.1: Single vibration
    • 1-620
      Section 91.2: Check for support
    • 1-621
      Section 91.3: Vibration patterns
    • 1-622
      Chapter 92: Battery Status API
    • 1-623
      Section 92.1: Battery Events
    • 1-624
      Section 92.2: Getting current battery level
    • 1-625
      Section 92.3: Is battery charging?
    • 1-626
      Section 92.4: Get time left until battery is empty
    • 1-627
      Section 92.5: Get time left until battery is fully charged
    • 1-628
      Chapter 93: Fluent API
    • 1-629
      Section 93.1: Fluent API capturing construction of HTML articles with JS
    • 1-630
      Chapter 94: Web Cryptography API
    • 1-631
      Section 94.1: Creating digests (e.g. SHA-256)
    • 1-632
      Section 94.2: Cryptographically random data
    • 1-633
      Section 94.3: Generating RSA key pair and converting to PEM format
    • 1-634
      Section 94.4: Converting PEM key pair to CryptoKey
    • 1-635
      Chapter 95: Security issues
    • 1-636
      Section 95.1: Reflected Cross-site scripting (XSS)
    • 1-637
      Section 95.2: Persistent Cross-site scripting (XSS)
    • 1-638
      Section 95.3: Persistent Cross-site scripting from JavaScript string literals
    • 1-639
      Section 95.4: Why scripts from other people can harm your website and its visitors
    • 1-640
      Section 95.5: Evaled JSON injection
    • 1-641
      Chapter 96: Same Origin Policy & Cross-Origin Communication
    • 1-642
      Section 96.1: Safe cross-origin communication with messages
    • 1-643
      Section 96.2: Ways to circumvent Same-Origin Policy
    • 1-644
      Chapter 97: Error Handling
    • 1-645
      Section 97.1: Error objects
    • 1-646
      Section 97.2: Interaction with Promises
    • 1-647
      Section 97.3: Error types
    • 1-648
      Section 97.4: Order of operations plus advanced thoughts
    • 1-649
      Chapter 98: Global error handling in browsers
    • 1-650
      Section 98.1: Handling window.onerror to report all errors back to the server-side
    • 1-651
      Chapter 99: Debugging
    • 1-652
      Section 99.1: Interactive interpreter variables
    • 1-653
      Section 99.2: Breakpoints
    • 1-654
      Section 99.3: Using setters and getters to find what changed a property
    • 1-655
      Section 99.4: Using the console
    • 1-656
      Section 99.5: Automatically pausing execution
    • 1-657
      Section 99.6: Elements inspector
    • 1-658
      Section 99.7: Break when a function is called
    • 1-659
      Section 99.8: Stepping through code
    • 1-660
      Chapter 100: Unit Testing JavaScript
    • 1-661
      Section 100.1: Unit Testing Promises with Mocha, Sinon, Chai and Proxyquire
    • 1-662
      Section 100.2: Basic Assertion
    • 1-663
      Chapter 101: Evaluating JavaScript
    • 1-664
      Section 101.1: Evaluate a string of JavaScript statements
    • 1-665
      Section 101.2: Introduction
    • 1-666
      Section 101.3: Evaluation and Math
    • 1-667
      Chapter 102: Linters - Ensuring code quality
    • 1-668
      Section 102.1: JSHint
    • 1-669
      Section 102.2: ESLint / JSCS
    • 1-670
      Section 102.3: JSLint
    • 1-671
      Chapter 103: Anti-patterns
    • 1-672
      Section 103.1: Chaining assignments in var declarations
    • 1-673
      Chapter 104: Performance Tips
    • 1-674
      Section 104.1: Avoid try/catch in performance-critical functions
    • 1-675
      Section 104.2: Limit DOM Updates
    • 1-676
      Section 104.3: Benchmarking your code - measuring execution time
    • 1-677
      Section 104.4: Use a memoizer for heavy-computing functions
    • 1-678
      Section 104.5: Initializing object properties with null
    • 1-679
      Section 104.6: Reuse objects rather than recreate
    • 1-680
      Section 104.7: Prefer local variables to globals, attributes, and indexed values
    • 1-681
      Section 104.8: Be consistent in use of Numbers
    • 1-682
      Chapter 105: Memory eciency
    • 1-683
      Section 105.1: Drawback of creating true private method
    • 1-684
      Appendix A: Reserved Keywords
    • 1-685
      Section A.1: Reserved Keywords
    • 1-686
      Section A.2: Identifiers & Identifier Names
    • 1-687
      Credits
    • 1-688
      You may also like

    常见问答

    您可以透過手機、平板或是電腦登入 HiSKIO 平台,在【我的學習】>【我的書籍】頁面,選擇想看的電子書。

    猜你喜欢

    用户评价

    | 收集中

    销售方案