如果我use strict用反引号/模板文字括起来,“使用严格”不会按预期工作。你能分享一下背后的原因吗?是否有任何类似的异常语句模板文字无法按预期工作?
`use strict`;
x = 3.14; // Ideally it should cause an error (as x is not defined).
alert(x);Run Code Online (Sandbox Code Playgroud)
`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);
Run Code Online (Sandbox Code Playgroud)