Global variable window object

<script type="text/javascript> function dad() { var eat = "this is the intenal var"; document.write(window.eat); } document.write("

"); dad();

sir why it is showing undefined output.