Download Full JavaScript Next: Your Complete Guide to the New Features Introduced in JavaScript, Starting from ES6 to ES9 1st Edition Raju Gandhi PDF All Chapters
Download Full JavaScript Next: Your Complete Guide to the New Features Introduced in JavaScript, Starting from ES6 to ES9 1st Edition Raju Gandhi PDF All Chapters
com
https://ebookmeta.com/product/javascript-next-your-complete-
guide-to-the-new-features-introduced-in-javascript-starting-
from-es6-to-es9-1st-edition-raju-gandhi/
OR CLICK HERE
DOWLOAD NOW
https://ebookmeta.com/product/enhancing-adobe-acrobat-forms-with-
javascript-take-your-forms-to-the-next-level-1st-edition-jennifer-
harder/
ebookmeta.com
The Truth about Forever and Lock and Key Sarah Dessen
https://ebookmeta.com/product/the-truth-about-forever-and-lock-and-
key-sarah-dessen/
ebookmeta.com
Biochemistry and Cell Biology of Ageing Part IV Clinical
Science 1st Edition J. Robin Harris
https://ebookmeta.com/product/biochemistry-and-cell-biology-of-ageing-
part-iv-clinical-science-1st-edition-j-robin-harris/
ebookmeta.com
https://ebookmeta.com/product/shared-by-the-aliens-viraxian-
mates-1-1st-edition-ren-hardwick-hardwick/
ebookmeta.com
https://ebookmeta.com/product/data-mining-with-spss-modeler-theory-
exercises-and-solutions-second-edition-tilo-wendler/
ebookmeta.com
https://ebookmeta.com/product/blood-and-marrow-transplantation-long-
term-management-2nd-edition-bipin-n-savani/
ebookmeta.com
JavaScript
Next
Your Complete Guide to the New Features
Introduced in JavaScript, Starting from
ES6 to ES9
—
Raju Gandhi
JavaScript Next
Your Complete Guide to the New
Features Introduced in JavaScript,
Starting from ES6 to ES9
Raju Gandhi
JavaScript Next
Raju Gandhi
Columbus, OH, USA
Introduction�����������������������������������������������������������������������������������������������������������xvii
v
Table of Contents
Rest Parameters������������������������������������������������������������������������������������������������������������������������� 33
The Argument Against arguments����������������������������������������������������������������������������������������� 33
The New ... Syntax����������������������������������������������������������������������������������������������������������������� 36
The rest of the Details (or is it the Details of rest?)��������������������������������������������������������������� 38
Summary������������������������������������������������������������������������������������������������������������������������������������ 39
vi
Table of Contents
Sets��������������������������������������������������������������������������������������������������������������������������������������������� 92
Caveats���������������������������������������������������������������������������������������������������������������������������������� 95
WeakSets������������������������������������������������������������������������������������������������������������������������������������ 95
Summary������������������������������������������������������������������������������������������������������������������������������������ 98
vii
Table of Contents
Generators�������������������������������������������������������������������������������������������������������������������������������� 138
Generators as Consumers��������������������������������������������������������������������������������������������������� 140
Cleaning Up������������������������������������������������������������������������������������������������������������������������� 141
Other Benefits���������������������������������������������������������������������������������������������������������������������� 143
Additional Syntactic Considerations������������������������������������������������������������������������������������ 144
Summary���������������������������������������������������������������������������������������������������������������������������������� 145
viii
Table of Contents
Index��������������������������������������������������������������������������������������������������������������������� 237
ix
About the Author
Raju Gandhi is a programmer with over 20 years of experience in the software industry.
He believes that the key to writing software users will cherish lies in having a keen
understanding of the problem, as well as intricate knowledge of the tools available to
solve those problems. He has been a core speaker on the No Fluff, Just Stuff symposium
series for over 7 years, along with other conferences like DevNexus, Connect.Tech, and
GIDS, India. In both his careers as a software developer and teacher, he believes the
key is to keep things simple, and in the words of Rich Hickey, “de-complected.” This
approach seems to scale well, for both maintainable software and happy audience
members.
xi
About the Technical Reviewers
Toby Jee is a software programmer currently located in Sydney, Australia. He loves
Linux and open source projects. He programs mainly in Java, JavaScript, Typescript, and
Python. In his spare time, Toby enjoys walkabouts, reading, and playing guitar.
xiii
Acknowledgments
Writing a book is a solitary pursuit. However, we sit on the shoulders of giants—past,
present, and future. This includes our families, teachers, and mentors who have
demonstrated to us the value of hard work and discipline, the technologists that came
before us who built what we sometimes take for granted, and finally, those who presently
work tirelessly to push the envelope and improve the status quo. I know that I have been
blessed to have had a chance to be influenced by many such greats—to every one of you
reading this book, you know who you are, and what you mean to me. Thank you.
I have had the privilege of speaking at many conferences, though one name in
particular stands out, namely, the No Fluff Just Stuff (NFJS) conference circuit. I am
indebted to Jay Zimmerman, the director of NFJS, for giving me a shot, as well as the
other speakers on the circuit as they continue to provide inspiration and share their
experiences. This book is the result of my having the chance to speak on this subject for a
while, but the meat of it comes from the interactions I have had with hundreds of smart,
talented developers around the world who made me question my own understanding of
the concepts, and forced me to dig deeper.
To Brian and Anne Sam-Bodden—my long-time employers, and more importantly,
friends—you have always had more faith in my capabilities than I did. You egged me
on to become a speaker and encouraged me to write a book. You provided me an
environment where I could experiment, and eventually flourish and thrive. I will always
remain indebted to you.
A special shout-out to my friend and mentor Dr. Venkat Subramaniam. Venkat is
someone I have come to lean on for everything between advice and camaraderie, both
personal and professional, and who, despite his frenetic schedule, always manages to
find the time to listen to me and provide a fair and unbiased perspective (often using
Dad jokes, but they get the job done).
To all the folks at Apress who made this book a reality, including Louise Corrigan,
Nancy Chen, and James Markham—thank you for your patience and hard work. It has
been a pleasure.
Despite the best efforts of all those involved in reviewing, editing, and proofreading
this book, any and all omissions and mistakes are mine, and mine alone.
xv
Acknowledgments
I would like to express my love and appreciation toward my significantly better half,
Michelle. She patiently took care of everything our lives threw at us, including taking
care of our boys, Mason and Micah, as I played recluse to work on this book. Of course,
I would be remiss if I did not mention our other two “children”—Buddy, our yorkie-
poodle, and Skye, our labradoodle—for providing unflinching companionship and
endless amounts of entertainment. Special thanks to my parents and sisters, who will
never admit to it but have been the catalyst in forming me into who I am.
Last, but certainly not the least, I tip my hat off to you, the reader. Your attention
is a scarce resource, and I appreciate the time you will spend with this book. Happy
learnings.
xvi
Introduction
JavaScript is everywhere—it runs single-page applications on the client side, is used
on the server side (with technologies like Node.js), helps build desktop applications
with Electron,1 and can be used to work with single-board computers like Raspberry
Pi.2 JavaScript is even used to train machine-learning models in the browser using
technologies like TensorFlow.js.3 All this to say, JavaScript is (arguably) the most
deployed language in the world—every desktop and laptop and every phone with an
embedded browser can run JavaScript. As it stands today, JavaScript exhibits many of the
features that one would expect from a language with this large a footprint.
But that wasn’t always the case.
JavaScript has a long history, spanning 24 years at the time of this writing. In this
time, JavaScript went from being a scripting language used to animate web pages to
one that is being used everywhere, and for everything. JavaScript’s reputation, however,
preceded itself—it was deemed quirky and error-prone, and not all the criticisms
were without merit. And everyone, including the TC39,4 the central committee that is
responsible for evolving JavaScript, took notice.
In 2015, ES6 was announced, which introduced a slew of new features and syntactic
changes to the language. The aim was simple—to usher JavaScript into the modern
Web era—armed with the features that developers were vying for, and provide the basis
for future editions of the language.
The result? A language that aims to improve developer experience, with constructs
that seem familiar to developers coming in from other languages. Alongside, a yearly
cadence for releasing future editions was announced, ensuring that JavaScript continues
to evolve and mature.
1
h ttps://electronjs.org
2
www.raspberrypi.org/
3
www.tensorflow.org/js
4
https://tc39.es/
xvii
Introduction
xviii
Introduction
This book does not aim to introduce new features chronologically (starting with
edition 6 all the way through 9); rather, I aim to collate features from multiple editions, as
long as they logically “reside” together. However, I do highlight which edition the feature
was introduced.
Many technical books give you a play-by-play, chapter-by-chapter breakdown of
what you are to find in the book. Truth be told, I have always found myself skipping over
the listing, preferring to stick to the table of contents, or heading straight for the index to
find what I am looking for. Consequently, I am going to save myself a few keystrokes, and
you a little time. I do hope you will understand, and perhaps forgive this omission.
5
https://babeljs.io/
xix
Introduction
Alternatively, the path of least resistance is to simply use your browser console. Most
modern browsers, like Chrome6 and Firefox,7 come equipped with a console.8 You can
simply copy and paste the examples found in this book in the console and experiment to
your heart’s desire.
Personally, I prefer to experiment in my text editor. If you are anything like me, and
prefer using a familiar medium, you will need Node.js installed. Follow the instructions
on their web site9 to install Node. If you already have Node installed and do not wish
to introduce a conflict, investigate “Node Version Manager”10 or “nvm-windows”11 that
allow you to install multiple versions of Node simultaneously.
Once Node is installed, create a scratch directory anywhere on your computer and
navigate to it. Then create a new file named hello-world.js with the following contents:
console.log('Hello JavaScript!');
Switch to the terminal, navigate to your scratch directory, and execute the following
command:
node hello-world.js
Hello JavaScript!
You can run all the examples in this book in this manner. This modus operandi will
serve you well, except for Chapter 12, where we talk about modules, wherein I provide
additional instructions.
Most editors allow for a way to execute code from within the editor itself using
extensions, plugins, or via a build system. Be sure to read the documentation of your
favorite editor to see how to enable this to allow for a quick feedback loop. Regardless of
the mechanism you employ, ensure that you are always using the correct version of Node.
Let’s write some modern JavaScript!
6
w ww.google.com/chrome/
7
www.mozilla.org/en-US/firefox/
8
In Google Chrome this can be found under View ➤ Developer ➤ JavaScript Console. In Mozilla
Firefox use Tools ➤ Web Developer ➤ Web Console.
9
https://nodejs.org/en/
10
https://github.com/nvm-sh/nvm
11
https://github.com/coreybutler/nvm-windows
xx
CHAPTER 1
1
© Raju Gandhi 2019
R. Gandhi, JavaScript Next, https://doi.org/10.1007/978-1-4842-5394-6_1
Chapter 1 let and const — The New Declarations on the Block
Thus, not only was the use of var overloaded, to add insult to the injury, it presented
us with a few stumbling blocks. Variables declared with var are automatically hoisted to
the top of the current scope. Furthermore, redeclaring two vars with the same name in
the same scope does not throw an error. Combine these two, and the result can prove to
be rather insidious as demonstrated here:
function insidious() {
var functionScoped = 'Outer declaration'; ①
if (true) {
var functionScoped = 'Inner declaration'; ②
}
console.log(functionScoped); ③
return functionScoped;
}
// prints 'Inner declaration'
insidious();
③ Turns out, the two variables are one and the same!
One may assume that the inner nested functionScoped is scoped within the if block,
which is not true! In fact, the second declaration of functionScoped is a no-op. However,
this does not prevent JavaScript from declaring the variable once (at the top) and then
reassigning the value of the variable further down, as reflected in the output. To avoid
any confusion, JavaScript developers tend to declare all the variables that are to be used
within a function upfront.
This notion of vars not being block scoped is certainly surprising, since many
languages scope variables lexically. That is, the variable in these languages is scoped
textually within the enclosing parentheses, and not visible outside of the scope created
by the block. This might lean one to believe that vars are scoped, when in reality they are
not, and can have inexplicable outcomes. Consider the following example:
function simulateDom() {
var pseudoDom = {
button1: {},
2
Chapter 1 let and const — The New Declarations on the Block
button2: {},
button3: {},
}; ①
console.log(pseudoDom.button1.click());
console.log(pseudoDom.button2.click());
console.log(pseudoDom.button3.click()); ③
return pseudoDom;
}
// prints 'Item 4 is clicked.' 3 times
simulateDom();
Since the variable i is hoisted outside the for loop, and is not local to the for loop
itself, every click handler “sees” the same i. At the end of the loop, the value of i is
predictably 4, which is reported on any button click.
Summarizing, any var declared within a function is scoped to that function, even if it
is defined within a block.
ES5 introduced strict mode as an opt-in feature as a way to restrict some JavaScript
behavior. This was done in part to make the transition to future versions of JavaScript easier,
by changing the semantics of the code and in particular disallowing some behaviors. While
strict mode does help prevent some rather nasty errors from occurring, for example,
inadvertently declaring “global” variables (variables declared within functions without the var
keyword), it does not change the scoping rules that we have discussed so far.
3
Chapter 1 let and const — The New Declarations on the Block
Using strict mode with ES5 code is highly encouraged, and as we embark on a journey to
understand and adopt ES6+, it would be prudent to incrementally introduce strict mode in
our existing scripts. This will certainly make converting them to ES6 easier. The documentation
for strict mode is available at https://developer.mozilla.org/en-US/docs/Web/
JavaScript/Reference/Strict_mode.
In summary, if all the above makes your head spin, then you are not alone.
Navigating JavaScripts scoping rules is hard enough; combining that with var-iable
hoisting further muddies the waters. In order to address some of the concerns
surrounding vars, ES6 activated1 let. let addresses many of the scoping deficits that
come with var as we will see in the following sections.
Why let instead of simply fixing var you might ask. Well, we wouldn’t want to go
about breaking the Internet, would we?
let
As you might have surmised, most of the confusion around vars exist because vars
do not respect “block” scope. A block in JavaScript is a way to collect one or more
statements; in other words, they allow us to create a compound statement. Blocks are
delimited by a pair of curly brackets, and if you are thinking, “Wait. Looping constructs
(like for and while) and conditional statements (like if and else) use curly brackets.
Are those blocks?” then you are right.
Blocks do not introduce scope. However, ES6 introduces block scope for variables
that are defined using the let keyword. A variable defined with the let keyword will be
scoped within the closest enclosing block. In other words, variables defined with the let
keyword are lexically scoped to the closest enclosing block:
function letFunction() {
// console.log('Before defining block', scopedLet); ①
if (true) {
let scopedLet = 'I am scoped within a block!'; ②
}
1
I say activated vs. introduced because let was always a reserved keyword in JavaScript.
4
Chapter 1 let and const — The New Declarations on the Block
// invoke it
letFunction();
We can breathe a sigh of relief! Variables declared with the let keyword seem to
follow the rules of scoping that you are used to coming from other languages, and they
do reduce the contextual overhead associated with vars.
Many of the issues (and potential bugs) that arise from the broad-reaching var scope
can be averted by using let instead. Let us revisit our earlier example of a simulated
DOM and see the effect of using let:
function simulateDom() {
let pseudoDom = {
button1: {},
button2: {},
button3: {},
};
console.log(pseudoDom.button1.click());
console.log(pseudoDom.button2.click());
console.log(pseudoDom.button3.click()); ③
5
Chapter 1 let and const — The New Declarations on the Block
return pseudoDom;
}
// prints 'Item 1 is clicked.', 'Item 2 is clicked.', 'Item 3 is clicked.'
simulateDom();
As we can see, variables declared with let do respect the scope of the enclosing
block, thus making the code a lot easier to reason about.
Although let does simplify the scoping rules for variables, they too come with a few
caveats, as we will see in the following section.
var foo;
{ ①
foo = function() {
console.log('I am', bar); ②
};
③ We define bar
6
Chapter 1 let and const — The New Declarations on the Block
We can surmise what happened here. The declaration of bar moved to the top of the
enclosing block, allowing it to be used prior to its declaration.
In and of itself, this feature (?) might not seem too troublesome. However, there is
another constraint that let presents us with. That is, you are not allowed to define two
variables in the same scope with the same name (this again is a departure from the
behavior of vars). JavaScript will throw a SyntaxError in that scenario.
Perhaps the following example will clarify things:
function determineFavoriteDrink(profession) {
switch (profession) {
case 'Programmer':
let drink = 'coffee'; ①
break
case 'Yoga instructor':
let drink = 'tea'; ②
break;
default:
let drink = 'water'; ③
break;
}
return drink;
}
// results in a 'SyntaxError'
console.log(determineFavoriteDrink('Programmer'));
① Introduce a variable
7
Chapter 1 let and const — The New Declarations on the Block
return {
increment: increment,
getCount: getCount,
}; ③
}());
// use it
// console.log(steps); ④
counter.increment(); ⑤
console.assert(counter.getCount() === 1); ⑥
let counter;
8
Chapter 1 let and const — The New Declarations on the Block
{ ①
let steps = 0; ②
let increment = function () { ③
console.log('increment');
steps++;
};
let getCount = function () {
return steps;
};
counter = {
increment: increment,
getCount: getCount,
}; ④
}
// use it
// console.log(steps); ⑤
counter.increment(); ⑥
console.assert(counter.getCount() === 1); ⑦
Both these examples attempt to limit the visibility of the increment and getCount
functions. However, leveraging let allows us to eliminate all the ceremony involved with
using vars.
9
Chapter 1 let and const — The New Declarations on the Block
const
ES6 activates another keyword, namely const. As the name suggests, this will define a
constant. In other words, it defines a variable whose value cannot be changed once they
have been declared.
Other than the fact that consts cannot be reassigned, everything we have discussed
so far about let applies to const as well—they have block scope, and will be hoisted to
the top of the enclosing block, and we cannot declare two consts with the same name in
the same scope.
It is important for us to bear in mind that it is the binding of a const variable that
cannot be changed. This has significance because JavaScript objects (such as Object and
Array) are inherently mutable. Which is to say, if a const were assigned a reference to an
object, it is that reference that cannot be changed; the object itself could change, and the
const would see that change. Perhaps this is easier seen in code.
// attempt re-assignment
// VALUE_REFERENCE = false ③
// ARRAY_REFERENCE = {}
① A value reference
② An object reference
10
Chapter 1 let and const — The New Declarations on the Block
Another point of note is declaring a const with no initial value also results in a
SyntaxError. Essentially declaring such a const will permanently assign the constant
to undefined, which is redundant considering JavaScript already has the undefined
keyword for such situations.
Finally, the JavaScript community has converged around the convention of naming
constant variables using upper case with underscores. This makes it easier to identify
constants within the codebase.
2
h ttps://immutable-js.github.io/immutable-js/
3
https://eslint.org/docs/rules/no-var
11
Chapter 1 let and const — The New Declarations on the Block
Summary
ES6 gives us several new constructs to declare and use variables in our code. let and
const allow us to use a declaration style which are more in tune with what we may be
used to in other languages. Their scoping rules permit easier reasoning of the code,
preventing bugs that often get introduced due to vars. As browser vendors offer us better
support for ES6 and beyond, it behooves us to embrace these new constructs. Going
forward, there is no reason to favor var anymore. let and const give us everything we
need, with the appropriate checks baked into the runtime. We should leverage linting
tools that allow us to enforce this, both at development time and during our continuous
builds.
In the next chapter, we will see another revolutionary change that landed in ES6,
namely a new syntax to define functions.
12
CHAPTER 2
13
© Raju Gandhi 2019
R. Gandhi, JavaScript Next, https://doi.org/10.1007/978-1-4842-5394-6_2
Exploring the Variety of Random
Documents with Different Content
last time I saw her—when was it? Monday. Yes, she struck me as
looking thoroughly depressed.’
‘Oh, but surely you were wrong . . .’ interrupted Stephen.
‘No, I’m perfectly sure I was right,’ he insisted. Then he said: ‘I’m
going to take a big risk—I’m going to take the risk of losing your
friendship.’
His voice was so genuinely regretful, that Stephen must ask him:
‘Well—what is it, Brockett?’
‘You, my dear. You’re not playing fair with that girl; the life she’s
leading would depress a mother abbess. It’s enough to give anybody
the hump, and it’s going to give Mary neurasthenia!’
‘What on earth do you mean?’
‘Don’t get ratty and I’ll tell you. Look here, I’m not going to pretend
any more. Of course we all know that you two are lovers. You’re
gradually becoming a kind of legend—all’s well lost for love, and that
sort of thing. . . . But Mary’s too young to become a legend; and so are
you, my dear, for that matter. But you’ve got your work, whereas
Mary’s got nothing—not a soul does that miserable kid know in Paris.
Don’t please interrupt, I’ve not nearly finished; I positively must and will
have my say out! You and she have decided to make a ménage—as
far as I can see it’s as bad as marriage! But if you were a man it would
be rather different; you’d have dozens of friends as a matter of course.
Mary might even be going to have an infant. Oh, for God’s sake,
Stephen, do stop looking shocked. Mary’s a perfectly normal young
woman; she can’t live by love alone, that’s all rot—especially as I
shrewdly suspect that when you’re working the diet’s pretty meagre.
For heaven’s sake let her go about a bit! Why on earth don’t you take
her to Valérie Seymour’s? At Valérie’s place she’d meet lots of people;
and I ask you, what harm could it possibly do? You shun your own ilk
as though they were the devil! Mary needs friends awfully badly, and
she needs a certain amount of amusement. But be a bit careful of the
so-called normal.’ And now Brockett’s voice grew aggressive and
bitter. ‘I wouldn’t go trying to force them to be friends—I’m not thinking
so much of you now as of Mary; she’s young and the young are easily
bruised. . . .’
He was perfectly sincere. He was trying to be helpful, spurred on
by his curious affection for Stephen. At the moment he felt very friendly
and anxious; there was nothing of the cynic left in him—at the
moment. He was honestly advising according to his lights—perhaps
the only lights that the world had left him.
And Stephen could find very little to say. She was sick of denials
and subterfuges, sick of tacit lies which outraged her own instincts and
which seemed like insults thrust upon Mary; so she left Brockett’s
bolder statements unchallenged. As for the rest, she hedged a little,
still vaguely mistrustful of Valérie Seymour. Yet she knew quite well
that Brockett had been right—life these days must often be lonely for
Mary. Why had she never thought of this before? She cursed herself
for her lack of perception.
Then Brockett tactfully changed the subject; he was far too wise
not to know when to stop. So now he told her about his new play,
which for him was a very unusual proceeding. And as he talked on
there came over Stephen a queer sense of relief at the thought that he
knew. . . . Yes, she actually felt a sense of relief because this man
knew of her relations with Mary; because there was no longer any
need to behave as if those relations were shameful—at all events in
the presence of Brockett. The world had at last found a chink in her
armour.
‘We must go and see Valérie Seymour one day,’ Stephen remarked
quite casually that evening. ‘She’s a very well-known woman in Paris. I
believe she gives rather jolly parties. I think it’s about time you had a
few friends.’
‘Oh, what fun! Yes, do let’s—I’d love it!’ exclaimed Mary.
Stephen thought that her voice sounded pleased and excited, and
in spite of herself she sighed a little. But after all nothing really
mattered except that Mary should keep well and happy. She would
certainly take her to Valérie Seymour’s—why not? She had probably
been very foolish. Selfish too, sacrificing the girl to her cranks—
‘Darling, of course we’ll go,’ she said quickly. ‘I expect we’ll find it
awfully amusing.’
Three days later, Valérie, having seen Brockett, wrote a short but
cordial invitation: ‘Do come in on Wednesday if you possibly can—I
mean both of you, of course. Brockett’s promised to come, and one or
two other interesting people. I’m so looking forward to renewing our
acquaintance after all this long time, and to meeting Miss Llewellyn.
But why have you never been to see me? I don’t think that was very
friendly of you! However, you can make up for past neglect by coming
to my little party on Wednesday. . . .’
Stephen tossed the letter across to Mary. ‘There you are!’
‘How ripping—but will you go?’
‘Do you want to?’
‘Yes, of course. Only what about your work?’
‘It will keep all right for one afternoon.’
‘Are you sure?’
Stephen smiled. ‘Yes, I’m quite sure, darling.’
CHAPTER 44
These, then, were the people to whom Stephen turned at last in her
fear of isolation for Mary; to her own kind she turned and was made
very welcome, for no bond is more binding than that of affliction. But
her vision stretched beyond to the day when happier folk would also
accept her, and through her this girl for whose happiness she and she
alone would have to answer; to the day when through sheer force of
tireless endeavour she would have built that harbour of refuge for
Mary.
So now they were launched upon the stream that flows silent and
deep through all great cities, gliding on between precipitous borders,
away and away into no-man’s-land—the most desolate country in all
creation. Yet when they got home they felt no misgivings, even
Stephen’s doubts had been drugged for the moment, since just at first
this curious stream will possess the balm of the waters of Lethe.
She said to Mary: ‘It was quite a good party; don’t you think so?’
And Mary answered naïvely: ‘I loved it because they were so nice
to you. Brockett told me they think you’re the coming writer. He said
you were Valérie Seymour’s lion; I was bursting with pride—it made
me so happy!’
For answer, Stephen stooped down and kissed her.
CHAPTER 45
Jamie was not always so full of desolation; there were days when she
seemed to be in excellent spirits, and on one such occasion she rang
Stephen up, asking her to bring Mary round after dinner. Every one
was coming, Wanda and Pat, Brockett, and even Valérie Seymour; for
she, Jamie, had persuaded a couple of negroes who were studying at
the Conservatoire to come in and sing for them that evening—they
had promised to sing Negro Spirituals, old slavery songs of the
Southern plantations. They were very nice negroes, their name was
Jones—Lincoln and Henry Jones, they were brothers. Lincoln and
Jamie had become great friends; he was very interested in her opera.
And Wanda would bring her mandolin—but the evening would be
spoilt without Mary and Stephen.
Mary promptly put on her hat; she must go and order them in some
supper. As she and Stephen would be there to share it, Jamie’s
sensitive pride would be appeased. She would send them a very great
deal of food so that they could go on eating and eating.
Stephen nodded: ‘Yes, send them in tons of supper!’
At ten o’clock they arrived at the studio; at ten thirty Wanda came in
with Brockett, then Blanc together with Valérie Seymour, then Pat
wearing serviceable goloshes over her house shoes because it was
raining, then three or four fellow students of Jamie’s, and finally the
two negro brothers.
They were very unlike each other, these negroes; Lincoln, the
elder, was paler in colour. He was short and inclined to be rather thick-
set with a heavy but intellectual face—a strong face, much lined for a
man of thirty. His eyes had the patient, questioning expression
common to the eyes of most animals and to those of all slowly
evolving races. He shook hands very quietly with Stephen and Mary.
Henry was tall and as black as a coal; a fine, upstanding, but coarse-
lipped young negro, with a roving glance and a self-assured manner.
He remarked: ‘Glad to meet you, Miss Gordon—Miss Llewellyn,’
and plumped himself down at Mary’s side, where he started to make
conversation, too glibly.
Valérie Seymour was soon talking to Lincoln with a friendliness that
put him at his ease—just at first he had seemed a little self-conscious.
But Pat was much more reserved in her manner, having hailed from
abolitionist Boston.
Wanda said abruptly: ‘Can I have a drink, Jamie?’ Brockett poured
her out a stiff brandy and soda.
Adolphe Blanc sat on the floor hugging his knees; and presently
Dupont the sculptor strolled in—being minus his mistress he migrated
to Stephen.
Then Lincoln seated himself at the piano, touching the keys with
firm, expert fingers, while Henry stood beside him very straight and
long and lifted up his voice which was velvet smooth, yet as clear and
insistent as the call of a clarion:
And all the hope of the utterly hopeless of this world, who must live
by their ultimate salvation, all the terrible, aching, homesick hope that
is born of the infinite pain of the spirit, seemed to break from this man
and shake those who listened, so that they sat with bent heads and
clasped hands—they who were also among the hopeless sat with bent
heads and clasped hands as they listened. . . . Even Valérie Seymour
forgot to be pagan.
He was not an exemplary young negro; indeed he could be the
reverse very often. A crude animal Henry could be at times, with a
taste for liquor and a lust for women—just a primitive force rendered
dangerous by drink, rendered offensive by civilization. Yet as he sang
his sins seemed to drop from him, leaving him pure, unashamed,
triumphant. He sang to his God, to the God of his soul, Who would
some day blot out all the sins of the world, and make vast reparation
for every injustice: ‘My home is over Jordan, Lord, I want to cross over
into camp ground.’
Lincoln’s deep bass voice kept up a low sobbing. From time to time
only did he break into words; but as he played on he rocked his body:
‘Lord, I want to cross over into camp ground. Lord, I want to cross over
into camp ground.’
Once started they seemed unable to stop; carried away they were
by their music, drunk with that desperate hope of the hopeless—far
drunker than Henry would get on neat whisky. They went from one
spiritual into another, while their listeners sat motionless, scarcely
breathing. While Jamie’s eyes ached from unshed tears quite as much
as from her unsuitable glasses; while Adolphe Blanc, the gentle, the
learned, grasped his knees and pondered many things deeply; while
Pat remembered her Arabella and found but small consolation in
beetles; while Brockett thought of certain brave deeds that he, even he
had done out in Mespot—deeds that were not recorded in dispatches,
unless in those of the recording angel; while Wanda evolved an
enormous canvas depicting the wrongs of all mankind; while Stephen
suddenly found Mary’s hand and held it in hers with a painful pressure;
while Barbara’s tired and childish brown eyes turned to rest rather
anxiously on her Jamie. Not one of them all but was stirred to the
depths by that queer, half defiant, half supplicating music.
And now there rang out a kind of challenge; imperious, loud,
almost terrifying. They sang it together, those two black brethren, and
their voices suggested a multitude shouting. They seemed to be
shouting a challenge to the world on behalf of themselves and of all
the afflicted:
The eternal question, as yet unanswered for those who sat there
spellbound and listened. . . . ‘Didn’t my Lord deliver Daniel, then why
not every man?’
Why not? . . . Yes, but how long, O Lord, how long?
Lincoln got up from the piano abruptly, and he made a small bow
which seemed strangely foolish, murmuring some stilted words of
thanks on behalf of himself and his brother Henry: ‘We are greatly
obliged to you for your patience; we trust that we have satisfied you;’
he murmured.
It was over. They were just two men with black skins and foreheads
beaded with perspiration. Henry sidled away to the whisky, while
Lincoln rubbed his pinkish palms on an elegant white silk