Answers for "global variables using strict mode"

0

global variables using strict mode

"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());
Posted by: Guest on July-27-2021

Browse Popular Code Answers by Language