标签: javascript typescript-generics
我是 TypeScript 的新手,我正在尝试学习 ${} 占位符并且我正在运行这个 helloworld.ts
${}
但我的输出是占位符的字面翻译:
答案 0 :(得分:3)
你必须使用反引号`。
const message: string = "My text"; console.log(`This will works ${message}`);
答案 1 :(得分:0)
没关系,我已经弄清楚了,您需要使用反引号而不是单引号。