【发布时间】:2018-11-10 12:56:36
【问题描述】:
我是 typescript/javascript/angular 的新手,我正在阅读一些教程,我经常遇到以下类型的事情:
class Point {
constructor(x, y) {
this.x = x;
this.y = y;
}
toString() {
return `(${this.x}, ${this.y})`;
}
}
现在我的问题是这些是物理反引号,而我看到的其他所有内容都只是使用 " 和 ' 我相信它们在功能上是相同的,所以这两个是真的:
` == '?` === '?
或者这是 Angular/Typescript 唯一的东西?
【问题讨论】:
-
${sth}和多行字符串。 -
简而言之:您可以将`用于多行字符串。但这可能不适用于较旧的浏览器。 ' 用于普通字符串。
-
感谢您的链接,抱歉我找不到那个答案。
标签: javascript angular typescript