(function() { 'use strict'; console.log(typeof someVariable); // prints "undefined" console.log(typeof anotherVariable); // also prints "undefined" var someVariable; var anotherVariable = "Defined"; })();