100% found this document useful (2 votes)
59 views58 pages

JavaScript: The New Toys T. J. Crowderinstant Download

The document is a promotional overview of the book 'JavaScript: The New Toys' by T.J. Crowder, which covers new features and updates in JavaScript from ES2015 to ES2020. It includes a detailed table of contents outlining various chapters that discuss topics like block-scoped declarations, new function features, classes, and asynchronous functions. Additionally, it provides links to download the book and other related resources.

Uploaded by

gebrimarris
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
59 views58 pages

JavaScript: The New Toys T. J. Crowderinstant Download

The document is a promotional overview of the book 'JavaScript: The New Toys' by T.J. Crowder, which covers new features and updates in JavaScript from ES2015 to ES2020. It includes a detailed table of contents outlining various chapters that discuss topics like block-scoped declarations, new function features, classes, and asynchronous functions. Additionally, it provides links to download the book and other related resources.

Uploaded by

gebrimarris
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 58

JavaScript: The New Toys T. J.

Crowder pdf
download

https://ebookmass.com/product/javascript-the-new-toys-t-j-
crowder/

Explore and download more ebooks at ebookmass.com


Here are some recommended products for you. Click the link to
download, or explore more at ebookmass.com

JavaScript T. J. Crowder

https://ebookmass.com/product/javascript-t-j-crowder/

Ethnopolitics in the New Europe John T. Ishiyama

https://ebookmass.com/product/ethnopolitics-in-the-new-europe-john-t-
ishiyama/

Understanding the Physics of Toys S Rajasekar

https://ebookmass.com/product/understanding-the-physics-of-toys-s-
rajasekar/

New Perspectives on HTML5, CSS3, and JavaScript 6th


Edition Patrick Carey

https://ebookmass.com/product/new-perspectives-on-html5-css3-and-
javascript-6th-edition-patrick-carey/
Toys and Communication 1st Edition Luísa Magalhães

https://ebookmass.com/product/toys-and-communication-1st-edition-
luisa-magalhaes/

The Marketing of Children’s Toys 1st ed. 2021 Edition


Rebecca C. Hains

https://ebookmass.com/product/the-marketing-of-childrens-toys-1st-
ed-2021-edition-rebecca-c-hains/

Technopopulism: The New Logic of Democratic Politics


Christopher J. Bickerton

https://ebookmass.com/product/technopopulism-the-new-logic-of-
democratic-politics-christopher-j-bickerton/

Javascript: Crash Course - The Complete Beginners Guide To


Learning JavaScript Programming In No Time! (Angularjs,
jQuery, JavaScript Visually) Nathaniel Hill
https://ebookmass.com/product/javascript-crash-course-the-complete-
beginners-guide-to-learning-javascript-programming-in-no-time-
angularjs-jquery-javascript-visually-nathaniel-hill/

Forging a New South: The Life of General John T. Wilder


1st Edition Nicely

https://ebookmass.com/product/forging-a-new-south-the-life-of-general-
john-t-wilder-1st-edition-nicely/
JavaScript®
THE NEW TOYS

T.J. Crowder

www.allitebooks.com
JAVASCRIPT®
THE NEW TOYS

INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxi

CHAPTER 1 The New Toys in ES2015–ES2020, and Beyond . . . . . . . . . . . . . . . . . . 1


CHAPTER 2 Block-Scoped Declarations: let and const . . . . . . . . . . . . . . . . . . . . . 17
CHAPTER 3 New Function Features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
CHAPTER 4 Classes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
CHAPTER 5 New Object Features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
CHAPTER 6 Iterables, Iterators, for-of, Iterable Spread, Generators . . . . . . . . . 131
CHAPTER 7 Destructuring. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
CHAPTER 8 Promises. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
CHAPTER 9 Asynchronous Functions, Iterators, and Generators . . . . . . . . . . . . 221
CHAPTER 10 Templates, Tag Functions, and New String Features. . . . . . . . . . . . 241
CHAPTER 11 New Array Features, Typed Arrays. . . . . . . . . . . . . . . . . . . . . . . . . . 263
CHAPTER 12 Maps and Sets. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
CHAPTER 13 Modules. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
CHAPTER 14 Reflection—Reflect and Proxy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
CHAPTER 15 Regular Expression Updates. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
CHAPTER 16 Shared Memory. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
CHAPTER 17 Miscellany. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461
CHAPTER 18 Upcoming Class Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493
CHAPTER 19 A Look Ahead … . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517
APPENDIX Fantastic Features and Where to Find Them . . . . . . . . . . . . . . . . . . 539

INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557

www.allitebooks.com
JavaScript®
The New Toys

www.allitebooks.com
JavaScript®: The New Toys
Copyright © 2020 by Thomas Scott “T.J.” Crowder

Published simultaneously in Canada

ISBN: 978-1-119-36797-6
ISBN: 978-1-119-36797-0 (ebk)
ISBN: 978-1-119-36796-3 (ebk)

Manufactured in the United States of America

10 9 8 7 6 5 4 3 2 1

No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means,
electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of
the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through
payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923,
(978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Permissions
Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online
at http://www.wiley.com/go/permissions.

Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with respect
to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including without
limitation warranties of fitness for a particular purpose. No warranty may be created or extended by sales or promotional
materials. The advice and strategies contained herein may not be suitable for every situation. This work is sold with the
understanding that the publisher is not engaged in rendering legal, accounting, or other professional services. If professional
assistance is required, the services of a competent professional person should be sought. Neither the publisher nor the author
shall be liable for damages arising herefrom. The fact that an organization or Web site is referred to in this work as a citation
and/or a potential source of further information does not mean that the author or the publisher endorses the information the
organization or Web site may provide or recommendations it may make. Further, readers should be aware that Internet Web
sites listed in this work may have changed or disappeared between when this work was written and when it is read.

For general information on our other products and services please contact our Customer Care Department within the United
States at (877) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002.

Wiley publishes in a variety of print and electronic formats and by print-on-demand. Some material included with standard print
versions of this book may not be included in e-books or in print-on-demand. If this book refers to media such as a CD or DVD
that is not included in the version you purchased, you may download this material at http://booksupport.wiley.com.
For more information about Wiley products, visit www.wiley.com.

Library of Congress Control Number: 2018965303

Trademarks: Wiley, the Wiley logo, Wrox, the Wrox logo, Programmer to Programmer, and related trade dress are
trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates, in the United States and other countries,
and may not be used without written permission. JavaScript is a registered trademark of Oracle America, Inc. All other
trademarks are the property of their respective owners. John Wiley & Sons, Inc., is not associated with any product or
vendor mentioned in this book.

www.allitebooks.com
To Wendy and James, who’ve met late nights and
working weekends with unstinting support and
loving encouragement.

www.allitebooks.com
ABOUT THE AUTHOR

T.J. CROWDER is a software engineer with 30 years of professional experience, at least half that time
working with JavaScript. He runs Farsight Software, a UK software consulting and product company.
As one of the top 10 contributors on Stack Overflow and the top contributor in the JavaScript tag, he
likes to use what he’s learned to help others with the technical challenges they’re facing, with an
emphasis not just on imparting knowledge, but on helping with the process of solving problems.
T.J. started programming in his early teens in California, playing around with the Apple II and
Sinclair ZX-80 and -81 using BASIC and assembly language. He got his first proper job with comput-
ers many years later, working a technical support position for a company with a PC (DOS) product
for court reporters. While working support, he taught himself C from the TurboC manuals in the
office, reverse-engineered the company’s undocumented, compressed binary file format, and used
that knowledge to create a much-requested feature for the product in his spare time (one the com-
pany soon started shipping). Before long the development department took him in and over the next
several years gave him the opportunity, resources, and responsibility to grow into a programmer and,
eventually, into their lead engineer, creating various products including their first Windows product.
At his next company he took on a professional services and developer education role that saw him
customizing the company’s enterprise product on-site for clients (using VB6, JavaScript, and HTML)
and teaching training classes to the clients’ developers; eventually he was writing the training classes.
A move from the U.S. to London put him back in a straight development role where he was able to
increase his software design, SQL, Java, and JavaScript skills before branching out into independent
contracting.
Since then through circumstance he’s been doing primarily closed-source remote development work
for a variety of companies and organizations (a NATO agency, a UK local government authority, and
various private firms) working primarily in JavaScript, SQL, C#, and (recently) TypeScript. The desire
for community led him first to the PrototypeJS mailing list back in the day, then to Stack Overflow,
and now to various platforms.
English and American by birth, American by upbringing, T.J. lives in a village in central England with
his wife and son.
ABOUT THE TECHNICAL EDITOR

CHAIM KRAUSE is an expert computer programmer with over thirty years of experience to prove it.
He has worked as a lead tech support engineer for ISPs as early as 1995, as a senior developer sup-
port engineer with Borland for Delphi, and has worked in Silicon Valley for over a decade in various
roles, including technical support engineer and developer support engineer. He is currently a military
simulation specialist for the US Army’s Command and General Staff College, working on projects
such as developing serious games for use in training exercises. He has also authored several video
training courses on Linux topics, and has been a technical reviewer for over two dozen books.
ABOUT THE TECHNICAL PROOFREADER

MARCIA K. WILBUR is a technical communicator consulting in the semiconductor field, focusing on


Industrial IoT (IIoT) and AI. Marcia holds degrees in computer science, technical communication,
and information technology. As Copper Linux User Group president, she is heavily involved with the
maker community leading West Side Linux + Pi and the East Valley leading regular Raspberry Pi, Bea-
glebone, Banana Pi/Pro, and ESP8266 Projects including home automation, gaming consoles, surveil-
lance, network, multimedia, and other “pi fun”.
ACKNOWLEDGMENTS

“I wrote a book” is almost never an accurate statement.


Sure, all the unquoted words in the book are mine. But none of them would be here if it weren’t for
others—others offering support, offering perspective, offering encouragement; others reviewing drafts
to help cut the chaff and reveal the nugget of usefulness buried within; others asking questions in a
variety of forums over the years, giving me the opportunity to practice the art and craft of explaining
what meager knowledge I’ve been able to pick up; others answering my questions, directly and by
pointing to resources; others helping hone my language and improve my wordcraft.
All of which waffle means: I owe thanks to a lot of people. This is my first proper book, and I made
just about every mistake there is to make. The people below caught and corrected as many of them as
they could. Any that remain are mine.
Primarily, thanks to my wife Wendy for her amazing support, for being an endless and willing source
of strength and font of encouragement, for bringing me back when (as James Taylor puts it) I find
myself careening in places where I should not let me go.
Thanks to my son James for putting up with Dad being squirrelled away in the office so much.
Thanks to my mother Virginia and father Norman for instilling in me a love of language, learning,
reading, and writing. These are gifts that last a lifetime.
Thanks to my best friend Jock for being an ever-patient sounding board and source of encourage-
ment—and, for that matter, for having been instrumental in getting me interested in programming in
the first place.
Thanks to all of my editors and reviewers at Wiley & Sons: Jim Minatel and Pete Gaughan for sup-
porting and maintaining the project even in the face of a frustrating author; David Clark and Chaim
Krause for editorial and technical review; Kim Cofer for her excellent copyediting and help with
grammar, syntax, and clarity; to Nancy Bell for her proofreading; to the artists and compositors in
the production department; and to all the others I’ve failed to mention by name for supporting all
aspects of the project.
Thanks to Andreas Bergmaier for helping me keep my technical T’s crossed and I’s dotted—Andreas’
keen eye and deep understanding were a huge help throughout the book.
Thanks to TC39 member Daniel Ehrenberg of Igalia for helping me better understand how TC39
works, and for kindly reviewing and helping me refine Chapter 1. His gentle corrections, input, and
insight dramatically improved that chapter.
Thanks to TC39 member Lars T. Hansen of Mozilla (co-author of the shared memory and atomics
JavaScript proposal) for his kind and invaluable help with getting the details and scope right in Chap-
ter 16. His deep knowledge and perspective made all the difference there.
And finally, thanks to you, dear reader, for giving your time and attention to my efforts here. I hope it
serves you well.
CONTENTS

INTRODUCTION xxxi

CHAPTER 1: THE NEW TOYS IN ES2015–ES2020, AND BEYOND 1

Definitions, Who’s Who, and Terminology 2


Ecma? ECMAScript? TC39? 2
ES6? ES7? ES2015? ES2020? 2
JavaScript “Engines,” Browsers, and Others 3
What Are the “New Toys”? 4
How Do New Toys Get Created? 6
Who’s in Charge 6
The Process 7
Getting Involved 8
Keeping Up with the New Toys 9
Using Today’s Toys in Yesterday’s Environments,
and Tomorrow’s Toys Today 10
Transpiling an Example with Babel 11
Review 15

CHAPTER 2: BLOCK-SCOPED DECLARATIONS: LET AND CONST 17

An Introduction to let and const 18


True Block Scope 18
Repeated Declarations Are an Error 19
Hoisting and the Temporal Dead Zone 20
A New Kind of Global 22
const: Constants for JavaScript 24
const Basics 24
Objects Referenced by a const Are Still Mutable 25
Block Scope in Loops 26
The “Closures in Loops” Problem 26
Bindings: How Variables, Constants, and Other Identifiers Work 28
while and do-while Loops 33
Performance Implications 34
const in Loop Blocks 35
const in for-in Loops 36
Visit https://ebookmass.com today to explore
a vast collection of ebooks across various
genres, available in popular formats like
PDF, EPUB, and MOBI, fully compatible with
all devices. Enjoy a seamless reading
experience and effortlessly download high-
quality materials in just a few simple steps.
Plus, don’t miss out on exciting offers that
let you access a wealth of knowledge at the
best prices!
Contents

Old Habits to New 36


Use const or let Instead of var 36
Keep Variables Narrowly Scoped 37
Use Block Scope Instead of Inline Anonymous Functions 37

CHAPTER 3: NEW FUNCTION FEATURES 39

Arrow Functions and Lexical this, super, etc. 40


Arrow Function Syntax 40
Arrow Functions and Lexical this 44
Arrow Functions Cannot Be Constructors 45
Default Parameter Values 45
Defaults Are Expressions 46
Defaults Are Evaluated in Their Own Scope 47
Defaults Don’t Add to the Arity of the Function 49
“Rest” Parameters 50
Trailing Commas in Parameter Lists and Function Calls 52
The Function name Property 53
Function Declarations in Blocks 55
Function Declarations in Blocks: Standard Semantics 57
Function Declarations in Blocks: Legacy Web Semantics 58
Old Habits to New 60
Use Arrow Functions Instead of Various this Value Workarounds 60
Use Arrow Functions for Callbacks When Not Using this or arguments 61
Consider Arrow Functions Elsewhere As Well 61
Don’t Use Arrow Functions When the Caller Needs to Control
the Value of this 62
Use Default Parameter Values Rather Than Code Providing Defaults 62
Use a Rest Parameter Instead of the arguments Keyword 63
Consider Trailing Commas If Warranted 63

CHAPTER 4: CLASSES 65

What Is a Class? 66
Introducing the New class Syntax 66
Adding a Constructor 68
Adding Instance Properties 70
Adding a Prototype Method 70
Adding a Static Method 72
Adding an Accessor Property 73
Computed Method Names 74
Comparing with the Older Syntax 75

xviii
Contents

Creating Subclasses 77
The super Keyword 81
Writing Subclass Constructors 81
Inheriting and Accessing Superclass Prototype Properties and Methods 83
Inheriting Static Methods 86
super in Static Methods 88
Methods Returning New Instances 88
Subclassing Built-ins 93
Where super Is Available 94
Leaving Off Object.prototype 97
new.target 98
class Declarations vs. class Expressions 101
class Declarations 101
class Expressions 102
More to Come 103
Old Habits to New 104
Use class When Creating Constructor Functions 104

CHAPTER 5: NEW OBJECT FEATURES 105

Computed Property Names 106


Shorthand Properties 107
Getting and Setting an Object’s Prototype 107
Object.setPrototypeOf 107
The __proto__ Property on Browsers 108
The __proto__ Literal Property Name on Browsers 109
Method Syntax, and super Outside Classes 109
Symbol 112
Why Symbols? 112
Creating and Using Symbols 114
Symbols Are Not for Privacy 115
Global Symbols 115
Well-Known Symbols 119
New Object Functions 120
Object.assign 120
Object.is 121
Object.values 122
Object.entries 122
Object.fromEntries 122
Object.getOwnPropertySymbols 122
Object.getOwnPropertyDescriptors 123
Symbol.toPrimitive 123
Property Order 125
xix
Contents

Property Spread Syntax 127


Old Habits to New 128
Use Computed Syntax When Creating Properties
with Dynamic Names 128
Use Shorthand Syntax When Initializing a Property
from a Variable with the Same Name 128
Use Object.assign instead of Custom “Extend”
Functions or Copying All Properties Explicitly 129
Use Spread Syntax When Creating a New Object
Based on an Existing Object’s Properties 129
Use Symbol to Avoid Name Collision 129
Use Object.getPrototypeOf/setPrototypeOf Instead of __proto__ 129
Use Method Syntax for Methods 130

CHAPTER 6: ITERABLES, ITERATORS, FOR-OF, ITERABLE


SPREAD, GENERATORS 131

Iterators, Iterables, the for-of Loop, and Iterable Spread Syntax 131
Iterators and Iterables 132
The for-of Loop: Using an Iterator Implicitly 132
Using an Iterator Explicitly 133
Stopping Iteration Early 135
Iterator Prototype Objects 136
Making Something Iterable 138
Iterable Iterators 142
Iterable Spread Syntax 143
Iterators, for-of, and the DOM 144
Generator Functions 146
A Basic Generator Function Just Producing Values 147
Using Generator Functions to Create Iterators 148
Generator Functions As Methods 149
Using a Generator Directly 150
Consuming Values with Generators 151
Using return in a Generator Function 155
Precedence of the yield Operator 155
The return and throw Methods: Terminating a Generator 157
Yielding a Generator or Iterable: yield* 158
Old Habits to New 163
Use Constructs That Consume Iterables 163
Use DOM Collection Iteration Features 163
Use the Iterable and Iterator Interfaces 164
Use Iterable Spread Syntax in Most Places You Used
to Use Function.prototype.apply 164
Use Generators 164
xx
Contents

CHAPTER 7: DESTRUCTURING 165

Overview 165
Basic Object Destructuring 166
Basic Array (and Iterable) Destructuring 169
Defaults 170
Rest Syntax in Destructuring Patterns 172
Using Different Names 173
Computed Property Names 174
Nested Destructuring 174
Parameter Destructuring 175
Destructuring in Loops 178
Old Habits to New 179
Use Destructuring When Getting Only Some Properties
from an Object 179
Use Destructuring for Options Objects 179

CHAPTER 8: PROMISES 181

Why Promises? 182


Promise Fundamentals 182
Overview 182
Example 184
Promises and “Thenables” 186
Using an Existing Promise 186
The then Method 187
Chaining Promises 187
Comparison with Callbacks 191
The catch Method 192
The finally Method 194
throw in then, catch, and finally Handlers 198
The then Method with Two Arguments 199
Adding Handlers to Already Settled Promises 201
Creating Promises 202
The Promise Constructor 203
Promise.resolve 205
Promise.reject 206
Other Promise Utility Methods 207
Promise.all 207
Promise.race 209
Promise.allSettled 209
Promise.any 210

xxi
Contents

Promise Patterns 210


Handle Errors or Return the Promise 210
Promises in Series 211
Promises in Parallel 213
Promise Anti-Patterns 214
Unnecessary new Promise(/*...*/) 214
Not Handling Errors (or Not Properly) 214
Letting Errors Go Unnoticed When Converting a Callback API 214
Implicitly Converting Rejection to Fulfillment 215
Trying to Use Results Outside the Chain 216
Using Do-Nothing Handlers 216
Branching the Chain Incorrectly 217
Promise Subclasses 218
Old Habits to New 219
Use Promises Instead of Success/Failure Callbacks 219

CHAPTER 9: ASYNCHRONOUS FUNCTIONS, ITERATORS, AND


GENERATORS 221

async Functions 222


async Functions Create Promises 224
await Consumes Promises 225
Standard Logic Is Asynchronous When await Is Used 225
Rejections Are Exceptions, Exceptions Are Rejections; Fulfillments
Are Results, Returns Are Resolutions 227
Parallel Operations in async Functions 229
You Don’t Need return await 230
Pitfall: Using an async Function in an Unexpected Place 231
async Iterators, Iterables, and Generators 232
Asynchronous Iterators 233
Asynchronous Generators 236
for-await-of 238
Old Habits to New 238
Use async Functions and await Instead of Explicit
Promises and then/catch 238

CHAPTER 10: TEMPLATES, TAG FUNCTIONS, AND NEW STRING


FEATURES 241

Template Literals 241


Basic Functionality (Untagged Template Literals) 242
Template Tag Functions (Tagged Template Literals) 243
String.raw 248

xxii
Contents

Reusing Template Literals 249


Template Literals and Automatic Semicolon Insertion 250
Improved Unicode Support 250
Unicode, and What Is a JavaScript String? 250
Code Point Escape Sequence 252
String.fromCodePoint 252
String.prototype.codePointAt 252
String.prototype.normalize 253
Iteration 255
New String Methods 256
String.prototype.repeat 256
String.prototype.startsWith, endsWith 256
String.prototype.includes 257
String.prototype.padStart, padEnd 257
String.prototype.trimStart, trimEnd 258
Updates to the match, split, search, and replace Methods 259
Old Habits to New 260
Use Template Literals Instead of String Concatenation
(Where Appropriate) 260
Use Tag Functions and Template Literals for DSLs Instead
of Custom Placeholder Mechanisms 261
Use String Iterators 261

CHAPTER 11: NEW ARRAY FEATURES, TYPED ARRAYS 263

New Array Methods 264


Array.of 264
Array.from 264
Array.prototype.keys 266
Array.prototype.values 267
Array.prototype.entries 268
Array.prototype.copyWithin 269
Array.prototype.find 271
Array.prototype.findIndex 273
Array.prototype.fill 273
Common Pitfall: Using an Object As the Fill Value 273
Array.prototype.includes 274
Array.prototype.flat 275
Array.prototype.flatMap 276
Iteration, Spread, Destructuring 276
Stable Array Sort 276

xxiii
Contents

Typed Arrays 277


Overview 277
Basic Use 279
Value Conversion Details 280
ArrayBuffer: The Storage Used by Typed Arrays 282
Endianness (Byte Order) 284
DataView: Raw Access to the Buffer 286
Sharing an ArrayBuffer Between Arrays 287
Sharing Without Overlap 287
Sharing with Overlap 288
Subclassing Typed Arrays 289
Typed Array Methods 289
Standard Array Methods 289
%TypedArray%.prototype.set 290
%TypedArray%.prototype.subarray 291
Old Habits to New 292
Use find and findIndex to Search Arrays Instead of
Loops (Where Appropriate) 292
Use Array.fill to Fill Arrays Rather Than Loops 292
Use readAsArrayBuffer Instead of readAsBinaryString 292

CHAPTER 12: MAPS AND SETS 293

Maps 293
Basic Map Operations 294
Key Equality 296
Creating Maps from Iterables 297
Iterating the Map Contents 297
Subclassing Map 299
Performance 300
Sets 300
Basic Set Operations 301
Creating Sets from Iterables 302
Iterating the Set Contents 302
Subclassing Set 303
Performance 304
WeakMaps 304
WeakMaps Are Not Iterable 305
Use Cases and Examples 305
Use Case: Private Information 305
Use Case: Storing Information for Objects Outside Your Control 307
Values Referring Back to the Key 308

xxiv
Contents

WeakSets 314
Use Case: Tracking 314
Use Case: Branding 315
Old Habits to New 316
Use Maps Instead of Objects for General-Purpose Maps 316
Use Sets Instead of Objects for Sets 316
Use WeakMaps for Storing Private Data Instead of Public Properties 317

CHAPTER 13: MODULES 319

Introduction to Modules 319


Module Fundamentals 320
The Module Specifier 322
Basic Named Exports 322
Default Export 324
Using Modules in Browsers 325
Module Scripts Don’t Delay Parsing 326
The nomodule Attribute 327
Module Specifiers on the Web 328
Using Modules in Node.js 328
Module Specifiers in Node.js 330
Node.js is Adding More Module Features 331
Renaming Exports 331
Re-Exporting Exports from Another Module 332
Renaming Imports 333
Importing a Module’s Namespace Object 333
Exporting Another Module’s Namespace Object 334
Importing a Module Just for Side Effects 335
Import and Export Entries 335
Import Entries 335
Export Entries 336
Imports Are Live and Read-Only 338
Module Instances Are Realm-Specific 340
How Modules Are Loaded 341
Fetching and Parsing 342
Instantiation 344
Evaluation 346
Temporal Dead Zone (TDZ) Review 346
Cyclic Dependencies and the TDZ 347
Import/Export Syntax Review 348
Export Varieties 348
Import Varieties 350

xxv
Contents

Dynamic Import 350


Importing a Module Dynamically 351
Dynamic Module Example 352
Dynamic Import in Non-Module Scripts 356
Tree Shaking 357
Bundling 359
Import Metadata 360
Worker Modules 360
Loading a Web Worker as a Module 360
Loading a Node.js Worker as a Module 361
A Worker Is in Its Own Realm 361
Old Habits to New 362
Use Modules Instead of Pseudo-Namespaces 362
Use Modules Instead of Wrapping Code in Scoping Functions 363
Use Modules to Avoid Creating Megalithic Code Files 363
Convert CJS, AMD, and Other Modules to ESM 363
Use a Well-Maintained Bundler Rather Than Going Homebrew 363

CHAPTER 14: REFLECTION—REFLECT AND PROXY 365

Reflect 365
Reflect.apply 367
Reflect.construct 367
Reflect.ownKeys 368
Reflect.get, Reflect.set 369
Other Reflect Functions 370
Proxy 371
Example: Logging Proxy 373
Proxy Traps 381
Common Features 381
The apply Trap 381
The construct Trap 382
The defineProperty Trap 382
The deleteProperty Trap 384
The get Trap 385
The getOwnPropertyDescriptor Trap 386
The getPrototypeOf Trap 387
The has Trap 388
The isExtensible Trap 388
The ownKeys Trap 388

xxvi
Contents

The preventExtensions Trap 389


The set Trap 389
The setPrototypeOf Trap 390
Example: Hiding Properties 391
Revocable Proxies 394
Old Habits to New 395
Use Proxies Rather Than Relying on Consumer Code
Not to Modify API Objects 395
Use Proxies to Separate Implementation Code from
Instrumenting Code 395

CHAPTER 15: REGULAR EXPRESSION UPDATES 397

The Flags Property 398


New Flags 398
The Sticky Flag (y) 398
The Unicode Flag (u) 399
The “Dot All” Flag (s) 400
Named Capture Groups 400
Basic Functionality 400
Backreferences 404
Replacement Tokens 405
Lookbehind Assertions 405
Positive Lookbehind 405
Negative Lookbehind 406
Greediness Is Right-to-Left in Lookbehinds 407
Capture Group Numbering and References 407
Unicode Features 408
Code Point Escapes 408
Unicode Property Escapes 409
Old Habits to New 413
Use the Sticky Flag (y) Instead of Creating Substrings and
Using ^ When Parsing 413
Use the Dot All Flag (s) Instead of Using Workarounds to
Match All Characters (Including Line Breaks) 414
Use Named Capture Groups Instead of Anonymous Ones 414
Use Lookbehinds Instead of Various Workarounds 415
Use Code Point Escapes Instead of Surrogate Pairs in
Regular Expressions 415
Use Unicode Patterns Instead of Workarounds 415

xxvii
Visit https://ebookmass.com today to explore
a vast collection of ebooks across various
genres, available in popular formats like
PDF, EPUB, and MOBI, fully compatible with
all devices. Enjoy a seamless reading
experience and effortlessly download high-
quality materials in just a few simple steps.
Plus, don’t miss out on exciting offers that
let you access a wealth of knowledge at the
best prices!
Exploring the Variety of Random
Documents with Different Content
X
She had failed entirely to make him sit down, for he continued to
refuse her invitation with the same haughty gravity, and responded
not at all to the one or two phrases with which she tried him.
“I have heard reports of your fame as a public speaker, Dene,” she
said with a propitiatory smile, forgetting for the moment that her
smiles were wasted on him.
“A lot of the chaps speak, my lady.”
“But without your advantages. Sir Robert tells me you are a very
highly-educated man.”
“No such luck, my lady.”
“Oh, come, Dene? Sir Robert says you are a great reader.”
“Somebody must ha’ been kiddin’ Sir Robert, my lady.”
She delighted in him. He was perfectly grave, and affected a
Lincolnshire accent, which he certainly had not possessed when he
first came into the room; a subtle insolence, but one which she did
not resent, for it demonstrated him as unwilling to prance out his
tricks, cheaply, at the bidding of a sophisticated curiosity, and she
was a woman who knew how to esteem superficial, although perhaps
not fundamental dignity. (Malleson had fundamental dignity, which,
poor man, had not served him to very much purpose with his wife.)
Also, she was emphatically a woman who maintained that the first
duty of sex in the game was to be a danger to the opposite sex. Dene
—certainly Dene fulfilled both these conditions! Acquaintance such
as hers with him was like a sojourn at the foot of a volcano which
might at any moment erupt. She relished the peril of the game. How
she stirred him to extravagance after extravagance! how she poked
and probed and decoyed his mind! encouraging, insinuating, blowing
upon the ready spark; “baiting Silas Dene,” she called it, as a baron
might have said, “baiting the bear”; all the better sport because she
knew it to be so quick with danger. She sent for him as often as she
dared, and when he was absent she thought about him, but always as
an experiment, an intellectual exercise. She was too cold-blooded a
schemer to allow herself to think of him now as anything else....
VI
I
Nan returned frequently along the road on the top of the dyke, on
the red and gray February evenings, when the stillness was absolute;
on either side of the dyke the floods lay, placid and flat as mirrors,
over broad miles of country, reflecting the crimson sun up a path of
roughened and reddened splendour. The water-filled ruts along the
road glowed with the same light; long narrow lines of fire. How
dismal that flooded land would have been without that light; gray,
only gray, without the red! All the most dismal elements were
present: a few isolated and half-submerged trees stuck up here and
there out of the water, and at intervals the upper half of a gate and
gate-posts protruded, the entrance to some now invisible field;
useless, ridiculous, and woebegone. But that red light, cold and fiery,
scored its bar of blood across the gray lagoons.
The village lay in front of her, at the end of the road, and behind
the village rose the three high chimneys of the factory, black amongst
the gray waters, the gray sky, threatening and desolate in the midst
of desolation. The three black plumes of smoke drifted upwards,
converged into a large leisurely volume, and dispersed; already in the
dusk the red glow at their base was becoming visible, and a single
star appeared high above them, as though a spark that had floated
out from the heart of the factory now hung suspended in supercilious
vigil. The abbey on the farther side lay heaped in a mass as dark as
the mass of the factory. Nan would shift to the other hand the basket
she was carrying home from the market-town of Spalding; walking
along the elevation of the dyke, she made a tiny, upright figure in the
great circle of the flat country, for here the disc of the horizon was as
apparent as it is at sea. The group of village, factory, and church,
emerged like an island loaded with strange and sombre piles of
architecture, adrift from all other encampments of men. Abbot’s
Etchery lay before her, against that formidable foundry of the
heavens, that swarthy splendour of smoke and sunset, and as she
continued to advance she thought that she re-entered an angry
prison, too barbarous, too inimical, for her to dwell beneath it, and
live.
II
The calm, cold weather broke late in February; a gale swept for two
nights and a day across the country, beating up the waters into little
jostling peaks and breaking from the forlorn trees branches that were
jerked hither and thither upon the waves, now coming to rest upon a
tussock of higher ground, now taken again by the shallow storm of
the floods, or tossed to lie against the bulwark of the dykes. The
smoke from the factory chimneys was snatched by the wind, and
swirled wildly away in coils and streamers, black smoke mingled with
the dark masses of cloud that drove across the disordered sky. Gulls
from the Wash flew inland,—the gulls, that more than any other bird
attune themselves to the season, in summer gleaming white, lovely
and marbled, on the wing, but in times of tempest matching the
clouds, iron-gray, the most desolate of birds.
It became unsafe for carts to travel along the road on the top of the
dyke, since one farm-cart, swaying already under an excessive load of
fodder, was caught by a gust of wind and overturned. After one
moment of perilous balance, it crashed down the embankment,
dragging after it the two frenzied horses, falling in a welter of broken
limbs, tangled harness, and splintered woodwork, while the trusses
of hay broke from their lashings and scattered into the borders of the
flood.
The storm of wind and water raged round this disaster, and folk
from the village collected on the top of the dyke to gape down at the
carter busy amongst the wreckage, and surreptitiously at Malleson,
the owner, who stood alone, more in sorrow for his valiant horses
than in regret over his material loss. There was no hope of saving the
horses,—they were shire horses, stately and monumental,—by the
time the crowd had assembled their tragic struggle had already
ceased. The carter was sullenly bending down, unbuckling the
harness; he would speak to no one. On the top of the dyke the gale
buffeted the little crowd, so that the men (their hands buried in their
pockets, their overcoats blown against their legs as they stood with
their backs to the winds, and their mufflers streaming) stamped their
feet to keep themselves warm, and the women with pinched faces
drew their black shawls more closely round their heads and
whispered dolefully together.
III
The accident greatly excited Silas Dene; it occurred on a Saturday
afternoon, and Nan, who was sewing in her own kitchen, heard upon
the wall the three thumps that were Silas’s usual summons. She
found him with Linnet Morgan, Hambley, and Donnithorne, one of
his mates, who had stopped on his way down the street to bring the
news.
Silas wanted Nan to go to the scene of the accident and to bring
him back a first-hand report. She cried out in dismay, appealing with
her eyes to both Morgan and Donnithorne. Hambley she ignored; his
very presence made her shudder, and she knew he would side with
Silas.
“But, Silas, I wouldn’t for the world! Those poor horses—what are
you asking me to do? to go and gloat over them?”
“Sentiment!” said Silas, who was angry. “Linnet says the same.
God, if I had eyes to use.... There’s violence and destruction half a
mile down the road, and you won’t go to see it. It maddens me, the
way you folk neglect the gifts and the opportunities God offers you.
Sentimentalists! A fine rough smash-up ... the wind’s a poet. A poet, I
say, wasting food and life for the mischief of it. The food of beasts,
and the life of beasts; wasted! There’s twenty trusses of hay in the
floods, so Donnithorne here tells me,—twenty trusses spoilt for
dainty-feeding cows,—and two fine horses smashed, and a big
wagon. They’re lying heaped at the bottom of the dyke. There’s blood
spilt, as red as the heat of the sun. No man would dare to bring all
that about for the sake of the mischief; but the wind’s a poet, I say—I
like the wind—he tears up in a minute trees that have persevered
inch by inch for a thousand years, and sends to the bottom ships full
of a merchant’s careful cargo. Well, you won’t go down the road and
tell a blind man about the smash?”
“Guts spilt, Mrs. Dene!” said Hambley, rubbing his hands together
and provoking her. She turned away from him with repulsion.
“Ye’re morbid, Silas,” said Donnithorne in disgust, his hand on the
latch. He was a red-headed, red-bearded man, with pale but
lascivious blue eyes that once had leered at Hannah, Silas’s wife.
“Morbid, am I? no, it’s you squeamish ones that are morbid, and I
that have the stout fancy. If Heaven had given me eyes! I wouldn’t be
such a one as you. I’d sooner be a fool playing with a bit of string,
and crooning mumble-jumble, or taking off my hat to a scarecrow in
the dusk.”
With that he bundled them all out, and slammed the door.
IV
Linnet Morgan followed Nan back into her own kitchen.
“Oh, Mr. Morgan, is Silas mad?” she said, turning to him at once.
“I sometimes don’t know what to make of him.”
“Would he go to look at the accident, do you think, if he could
see?”
“Not he!” said Morgan, “not he! But he’s safe to say so. He turned
pale when Donnithorne told him about it, but next minute he was
pretending to be all eager, like you heard him.”
They remained standing, occupied with their own thoughts.
Gregory glanced up from his drawings as they came in, but otherwise
took no notice of them. Morgan sat down before the range, and
began prodding a piece of firewood between the small open bars.
“I lose my bearings, living with Silas,” he said presently; “amongst
all his manias, he’s got this mania for destruction. Perhaps the long
and short of it is, that he likes talking loud about big noisy things,
when he’s certain they won’t come near him to hurt him. Being blind
keeps him safe.... Mrs. Dene, come for a turn with me. You look right
white and scared. Come out, and let the wind blow away bad
thoughts?”
“I’ll ask Gregory to come with us.” She went over to her husband,
touched him on the arm to attract his attention, and spoke to him on
her fingers. “He says he’s busy with his drawings, but will we go
without him.”
V
They took the road that led in the opposite direction from the
accident, and uncharitable eyes watched them go past the windows
of the houses in the village. But they walked all unconscious, feeling
relieved and with a gay sense of holiday, almost a sense of truancy;
and when the wind caught them as they left the shelter of the village,
and forced them to a breathless standstill, they laughed, and
struggled on again, exhilarated by their fight against so clean and
natural a foe. They were soon in the open country, having left the
village behind; they breasted the wind, and breathed it deeply,
tasting, or fancying that they tasted, upon their lips the salt of the
flying spray. The road which they followed lost the monotony of its
straightness when they conquered it yard by yard, and remembered
that, did they but follow it far enough, it would lead them eventually
to the sea.
There was indeed a regal splendour about the day, about the
embattled sky and driven clouds. The northern forces had been
recklessly unleashed. The sea would be beaten into a tumult full of
angry majesty. How wild a day, how arrogant a storm!
VI
Coming back, the wind almost forced them into a run, and they
yielded, racing along the road, impelled as by a strong hand. They
could not speak to one another in the midst of the turmoil, but they
smiled from time to time in happy understanding. As they neared the
village Nan checked herself, and, leaning breathless against one of
the telegraph-posts that bordered the road, tried to re-order her hair,
but the wind took her shawl and blew it streaming from her hand,
also the strands of her hair in little wild fluttering pennons.
Nevertheless, she was in such high good humour that she only
laughed at what might have been an annoyance, turning herself this
way and that to gain the best advantage over the wind. Morgan stood
by, laughing himself, and watching her. She wore a dark red shirt,
and the wind had blown two patches on to her cheeks, which were
usually so pale they looked fragile and transparent. They continued
more soberly towards the village, still without speaking, even when
they reached the shelter of the street, because it seemed unnecessary.
They saw Silas standing on his own doorstep, hatless, in a strange
attitude, holding his hands stretched out before him, the fingers wide
apart. Nan ran up and caught one of his hands; Morgan was
surprised, for she never treated Silas with levity. She seemed to have
shaken off the years of repression, to have forgotten totally the
conscientious lesson.
“What are you doing standing there, Silas?” She was very gay.
“Letting the wind whistle in my fingers. Hark! Bend down your
head.”
“I can’t hear it, Silas.”
“No, you’ve coarse ears; eyes! eyes! yes! but coarse ears. Where
have you been?”
“Along the dyke....”
“Seen the accident?”
“Hush, Silas; you shan’t dwell on that.” Morgan had never seen her
so brave, so radiant, with the blind man. She took his arm now,
leading him back into his cottage. “Sit down by the fire, Silas; it’s
warm and sheltered in here. The kettle’s singing.”
“I’d sooner stay in the wind,” he said, striving against the light
pressure of her hands on his shoulders as she held him down.
“The wind’s too rough; I’ve had enough of it.”
“Then let me stay on the doorstep alone. You stop in the shelter
with Linnet.”
“No, Silas, we’ll all three stop in here together. I’ll sing to you a bit,
shall I?” Morgan observed her firmness with a surprised admiration.
She got her zither from the cupboard where she kept it, laid it on
the table, and tried the chords with a little tortoiseshell clip that she
slipped over her thumb. The thin notes quivered through the bluster
of the wind and the harshness of Silas’s voice. She bent intently over
her tuning, trying the notes with her voice, adjusting the wires with
the key she held between her fingers.
“Now!” she said, looking up and smiling.
She sang her little sentimental songs, “Annie Laurie,” and “My boy
Jo,” her voice as clear and natural as the accompaniment was
painstaking. She struck the wires bravely with her tortoiseshell clip.
Morgan applauded.
“It’s grand, Mrs. Dene.”
“Why do you choose to-day for your zither?” Silas asked in his
most rasping tone.
“It’s Sunday, Silas,—a home day.”
“But you’re not home; you’re in my cottage; your home is with
Gregory, next door. You’re here with me and Linnet.”
“Gregory can’t hear me sing,” she said pitifully.
“Then why don’t you dance? he could see you dance.”
“I asked him to come for a walk,” she said, her brightness dimmed
by tears.
“And he wouldn’t go? with you and Linnet?”
“No, he was drawing.”
“Ah?” said Silas. “But Linnet went with you? Linnet wasn’t busy?”
“What’ll I sing that pleases you?” she said, maintaining her
endeavour; “‘Loch Lomond?’ You used to like ‘Loch Lomond.’”
“Ask Linnet; he’s Scotch; no doubt that’s what put a Scotch song
into your mind.”
“Silas!” she said in despair, dropping her hands on to her zither,
which gave forth a jangle of sounds.
“If you want home, as you say, stop here with Linnet; I’ll lend you
my cottage,” said Silas, rising and groping for his cap. “Play at home
for a bit. Draw the curtains, light the lamp, make tea for yourselves,
put the kettle back to sing on the hob, and you, Nan, sing to your
zither to your heart’s content. It’s a pleasant, warm room, for
pleasant, warm people. Home of a Sunday, with the wind shut out!
Oh yes, I’ll lend you my cottage. Gregory’s lost in his drawings till
supper-time. Stay here and talk and smoke and sing, while the room
grows warmer, and you forget the wind and the two dead horses and
spoilt fodder lying down the road. Spend your evenings in
forgetfulness. Ask no questions of sorrow. Kill darkness with your
little candle of content.”
“You’re crazy; where are you going?” cried Morgan.
“Only to the Abbey,—not into the floods,” Silas replied with a
laugh.
“To the Abbey? alone?”
“One of my haunts, you know.”
VII
Silas found his way along the village street by following the outer
edge of the pavement with his stick; as he went he snorted and
muttered. “I’ll have nothing to do with Nan’s kindness,” he said to
himself several times. “She’s easily satisfied; she’s comfortable; she’s
grateful. She shuts the eyes that she might see with.” This thought
made him very angry, and he strode recklessly along, knocking
against the few folk that were abroad on that inclement evening. One
or two of them stopped him with a “Why, Dene! give you a hand on
your way anywhere?” but he rejected them, as he was determined to
reject all comfort and patience that Nan might offer him. He liked
the wind, that opposed him and made his progress difficult; he
struck out against it, the struggle deluding him into a reassuring
illusion of his own courage. He welcomed the wind for the sake of
that tortuous flattery....
He would have made his way to Lady Malleson, but he was afraid
to venture under the trees in the park, where a bough might be blown
down upon him.
VIII
At the end of a side-street the Norman abbey rose, black and
humped and semi-ruined, the huge dark clouds of the evening sky
sailing swiftly past the ogive of its broken arches. The village had
retreated from the abbey, because the abbey’s furthermost walls were
lapped by the floods, so that it remained, the outer bulwark of man’s
encampment upon the inviolate mound in the midst of the
inundations; it remained like some great dark derelict vessel, half
beached upon dry land, half straining still towards the waters. The
street which led to it was a survival of the ancient town, gabled and
narrow, with cobbled ground; Silas tapped his way over the cobbles.
He could not see the enormous mass of tower and buttress and great
doorway, that blocked the end of the street before him, but he heard
the scattered peal of bells, and the deep gloom of the abbey lost
nothing in passing through the enchantment of his blind fancy. He
entered, and was swallowed up in shadows. The roof was lost in a
sombre and indistinguishable vault. The aisles became dim
colonnades, stretching away into uncertain distance. The pillars with
their bulk and gravity of naked stone dwarfed the worshippers that
rustled around their base. The organ rumbled in the transept. Silas
moved among the aisles, handing himself on from pillar to pillar; he
imagined that he moved in a forest, touching his way from tree-trunk
to tree-trunk; he conceived the abbey as illimitable, and relished it
the more because ruin had impaired the intention of the architecture.
The organ from its rumbling broke out into its full volume, a giant
treading in wrath through the forest, a storm rolling among the
echoes of the hills. Night came, and the clouds moved invisibly past
overhead, over the abbey and the floods. Nothing but the dark flats of
water lay between the abbey and the sea; its bells gave their music to
the wind, and the great voice of its organ was more than a man-made
thing. The black shape of the abbey on the edge of the desolate floods
bulked like a natural growth rooted in old centuries, harmonious and
consonant with nature. To the vision of Silas Dene, on which no
human limitations were imposed, and whose mind was fed on sound
and thought alone, the abbey was not less vast than night itself, only
a night within the night, an abode of ordered sound within the gale of
sound. In his fancy he was not clear as to whether it were roofed
over, or lay open to the sky; he could vary his decision according to
the vagary of the moment, alternately picturing the rafters high
above his head, or the scudding moonlit heavens of ragged black and
silver. He put his hands upon the pillars with no thought of man’s
construction; they seemed monolithic. He caressed them, moving
between them, leaning against them, and listening to the organ. He
was in a large, dim, mysterious place, that had a kindred with the
floods and with the storm. He knew that all around him were
shadows which, while making no difference to the perpetual shadow
he himself lived in, obscured and hampered the free coming and
going of other men. Darkness was to him a confederate and an
affinity; he would smile when people spoke of nightfall or of an
impenetrable fog. He searched now with his hand until it touched the
shoulder of a kneeling woman.
“Are there any lights in the church?” he whispered.
“Why, surely!” she said, startled, “candles upon the altar.”
He was displeased; he moved behind a column where he knew the
shadows would be deeper. The organ had ceased, and he heard
prayers. He shook with inward mockery, confident that the abbey,
which he had endowed with a personality and had adopted into his
own alliance, would reject the prayers as contemptuously as he
himself rejected them. It would await the renewed majesty of the
organ.... To Silas the organ represented no hymn of praise; it
represented only the accompaniment of storm; he was not even
troubled, because he did not notice them, by the infantile words
which the congregation fitted to its chords. It had never occurred to
him to think of the abbey as a holy temple until he came by chance
upon a thing to which his imagination made a kindled and ravenous
response.
For once he had not made for himself the discovery of this new
theme in the course of his reading. He owed it, a resented debt, to the
conversation of his mates in the shops. Silas, listening, had felt his
ever-ready contempt surging within him; it angered him to learn
from illiterate men of a subject that he alone amongst them was
fitted to understand. They skirted round it; but he grasped it avidly,
adopting it, as though a niche in his mind had been always waiting
for it. He took it with him to the abbey, like a man carrying
something secret and deadly under his cloak. Black Mass....
He scarcely knew what it meant. He took it principally as a symbol
of distortion and mockery. It seemed to be one of the phrases and
summings up he had always been searching for, he who liked to
condense a large vague district of imaginings into a final phrase.
When he remembered Black Mass in the ordinary way, he smiled
in satisfaction, and stowed it away as a secret; but when he thought
of it in the abbey he hunched himself as though he were in the throes
of some physical pleasure. In bringing that thought with him into the
abbey he was taunting a tremendous God, a revengeful God; and he
exalted fearfully in the latent implication of his own daring. Surely
courage could go no further than the defiance of God! His ready
ecstasy swept him away. The world he lived in was a reversed world,
where darkness held the place of light; in the world of his soul a
similar order should prevail. Taut-strung, he cast around for some
piece of blasphemy, some monstrous thing that he could do,—he did
not know what. He only knew that now he was brave, though it might
be with the courage of hysteria; presently he would be again afraid.
He dreaded the return of his cowardice. He had not been a coward
the day he had killed Hannah; only afterwards; he must not dwell
upon the afterwards.
He had no weapon with him in the church except his voice, and a
penknife in his pocket.
He must achieve something; something! anything!
In the midst of his excitement he took it into his head that a piece
of the ruined masonry, detached by the wind, might fall in upon him
and crush him. Still chattering under his breath to himself, his hands
nervously working, he moved closer to the shelter of the pillar. Here
he felt more secure, but still the gusts of storm sent waves of physical
anxiety through him. He was torn between that small anxiety and the
illimitable defiance.
The organ swelled out again, lifting him upon its great rhythm as a
wave lifts a swimmer.
VII
I
It was on the same unpropitious evening that Silas’s only son
returned to his home from Canada.
The train discharging him at Spalding, he fought his way against
wind and rain, along the lonely road on the top of the dyke. He
trudged with his hands in his pockets and a bundle on his back, the
peculiar bleakness of the road returning familiarly to him after his
absence of seven years. It was dark, but through occasional rifts the
moon appeared, showing him the floods; they were familiar too,—
their wide flat stretches lying on either side of the high dyke, and
swept by the East Anglian wind straight from the North Sea,—he
knew in his very bones the shape and sensation of the Fens; this was
homecoming. There was a knowledge, a grasp of the size, shape, and
colour—almost of taste and smell—a consciousness that marked off
home from any other place.
When he reached the village, he felt in similar manner the
presence of the factory on the one hand, and of the abbey on the
other, with the village lying between them. His boots rang on the
stone of the pavements. That was the school, and this the concert-
room.... He reached the double cottage of his father and his uncle; he
thought he would surprise his father and mother, so without
knocking he turned the door-handle and went in.
Nan was still sitting by the table on which her zither lay; her hands
were clasped and drooped listlessly. Her whole attitude betrayed her
dejection. Morgan stood by the range talking. They were alone, and
young Dene recoiled, thinking he had broken in upon strangers,
though the smile was still broadly upon his face, with which he had
prepared to greet his parents’ surprise.
“I’ve made a mistake,” he muttered, “this used to be Silas Dene’s
cottage ... my name’s Martin Dene.”
He was a bronzed young man, with thick black hair, a Roman nose,
and a fine curved mouth; a proud face, like the face upon a coin.
“Can you tell me where my father lives now?” he added. He looked
at them frankly; he took them for a young married couple.
“Why, Martin!” cried Nan, recognising him.
“Why, it’s Nancy Holden,” he said almost at the same moment.
They greeted one another gladly. “You’re married? living here?” he
asked, with a glance at Morgan.
“Married to your uncle Gregory....”
“No! He could be your father!” exclaimed young Dene naïvely, and
again he glanced at Morgan.
“Oh, no,” said Nan, flushing, and she hurried on with an
explanation, “Your father lives here still, but he went out a little time
back; he said he was going to the abbey. He’ll be in presently. Sit
down; I’ll get you a cup of tea.”
“But where’s mother?” asked Martin Dene, and in his impulsive,
attractive manner he strode across the room, flung open the door
that led to the staircase, and shouted “Mother!”
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.

More than just a book-buying platform, we strive to be a bridge


connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.

Join us on a journey of knowledge exploration, passion nurturing, and


personal growth every day!

ebookmasss.com

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy