60 assert.equal(error.name, "RPCError");
61 assert.equal(
62 error.message,
63 "is_valid_account_name( name ): Account name ${n} is invalid n=",64 );
65 const info = VError.info(error);
66 assert.equal(info.code, 10);
ECMAScript 6 allows programmers to create strings containing variable or expressions using template literals, instead of string concatenation, by writing expressions like ${variable}
between two backtick quotes ().
It is easy to use the wrong quotes when wanting to use template literals, by writing
${variable}, and ending up with the literal value
${variable}` instead of a string containing the value of the templated expressions.
"Hello ${name}!";
'Hello ${name}!';
"Time: ${12 * 60 * 60 * 1000}";
`Hello ${name}!`;
`Time: ${12 * 60 * 60 * 1000}`;
templateFunction`Hello ${name}`;