【发布时间】:2019-01-08 14:37:37
【问题描述】:
test.html:
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
</head>
<body>
<script src="test.js"></script>
</body>
</html>
test.js:
let fName = "Nick";
let lName = "Lee";
document.write('${fName}');
Chrome 上的输出:
${fName}
我以为是尼克。
【问题讨论】:
-
使用正确的符号,阅读docs for template literals。
标签: javascript html ecmascript-6