Edit in JSFiddle

(function () {
        var dog = "German Shepherd";
        alert(dog);
})();
alert(dog); //拋出not defined錯誤