var type = "Red", attack = function() { typeOfBird = type + " Bird"; window.message = typeOfBird + " Attacks!"; return typeOfBird + " Bird Attacks!"; }; console.log( window.type ); // I'm a global variable console.log( window.attack() ); // I'm a global function console.log( window.typeOfBird ); // I'm a global variable too :( console.log( window.message ); // I'm a global variable too :|