JavaScript 中反引号 (`) 的用法 - Usage of the backtick character (`) in JavaScript

语言: CN / TW / HK

问题:

In JavaScript, a backtick seems to work the same as a single quote.在 JavaScript 中,反引号似乎与单引号的作用相同。 For instance, I can use a backtick to define a string like this:例如,我可以使用反引号来定义这样的字符串:

var s = `abc`;

Is there a way in which the behavior of the backtick actually differs from that of a single quote?反引号的行为实际上与单引号的行为不同吗?


† Note that among programmers, "backtick" is one name for what is more generally called the grave accent . † 请注意,在程序员中,“反引号”是更普遍称为重音符号的名称之一 Programmers also sometimes use the alternate names "backquote" and "backgrave".程序员有时也使用 备用名称“反引号”和“背刻”。 Also, on Stack Overflow and elsewhere, other common spellings for "backtick" are "back-tick" and "back tick".此外,在 Stack Overflow和其他地方,“反引号”的其他常见拼写是“反引号”和“反引号”。


解决方案:

参考一: http://stackoom.com/question/1s8KC
参考二: Usage of the backtick character (`) in JavaScript
「其他文章」