如果我use strict
用反引号/模板文字括起来,则“使用严格”不会按预期工作。你能分享一下背后的原因吗?是否有任何类似的异常声明模板文字无法按预期工作?
`use strict`;
x = 3.14; // Ideally it should cause an error (as x is not defined).
alert(x);
`use strict`; // if we enclose in single quotes or double quotes
x = 3.14; // Ideally it should cause an error (as x is not defined).
alert(x);