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