Hemanth M

Hemanth M

  • NA
  • 2
  • 3.9k

Global variable is not updated javascript

Jun 30 2017 8:09 AM
I have globe.js, demo1.html , demo2.html here im declared var a = 10; in the global and then i reassigned the value of variable a in the demo1 window.a = 20 then i have anchor tag click to redirect to demo2 now im checking the value of a here alert(a); still it shows the global variable value 10 but i have been reassigned in demo1 showing old value of global please help me to find out...

Answers (3)