我在使用TypeScript连接字符串时遇到了困难.
码:
var info= {user:'med'};
console.log('le nom est:${info.user}');
Run Code Online (Sandbox Code Playgroud)
结果是:
le nom est:$ {info.user}
如何在TypeScript中连接2个字符串?
Pal*_*leo 16
使用模板字符串:
console.log(`The name is: ${info.user}`);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7313 次 |
| 最近记录: |