function init() { var name = "hogehoge"; function displayName() { alert(name); } displayName(); } init();