Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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());
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #global #variables #strict #mode
ADD COMMENT
Topic
Name
7+5 =