📜  使用严格模式的全局变量 - 无论代码示例

📅  最后修改于: 2022-03-11 14:59:50.191000             🧑  作者: Mango

代码示例1
"use strict"; // Turns on strict mode for this compilation unit

function foo() {
    var variable1, variable2;

    variable1 = 5;
    varaible2 = 6;                 // <=== ReferenceError
    return variable1 + variable2;
}
console.log(foo());