Posted By

khaled on 09/09/10


Tagged


Versions (?)

Local & Global Variable in Javascript (2)


 / Published in: JavaScript
 

يمكنني حذف السطر الثالث دون حدوث أي مشاكل

  1. <script type="text/javascript">
  2.  
  3. var MyVariable; // Delete this line
  4.  
  5. function x()
  6. {
  7. MyVariable = 'Hello, World!';
  8. }
  9.  
  10. function y()
  11. {
  12. alert(MyVariable);
  13. }
  14.  
  15.  
  16. x();
  17. y();
  18. </script>

Report this snippet  

You need to login to post a comment.