nsu*_*239 -1 javascript template-strings visual-studio-code
模板字符串应可在任何终端上使用,例如Visual Studio代码终端或Windows终端。但事实并非如此。我做了这段代码Visual Studio代码。这是我的代码
var name = 'Andrew';
console.log('Hello ${name}');Run Code Online (Sandbox Code Playgroud)
输出是
Hello ${name}
Run Code Online (Sandbox Code Playgroud)
Please specify changes in my code needed and explain why it doesn't work currently.
Single and double quotes wont invoke the behavior - use back ticks.
var name = 'Andrew';
console.log(`Hello ${name}`);
// ^ ^Run Code Online (Sandbox Code Playgroud)
More information on Template literals,
| 归档时间: |
|
| 查看次数: |
1251 次 |
| 最近记录: |