Javascript - Variable without using the var keyword

by sunil ravulapalli /4. January 2012 22:39 /javascript /Comments (0)

Quick Tip
If you have a function like below where "temp" is declared and assigned without using the "var" keyword, it becomes a global variable!

function doSomething()
{
  temp=1;
}
blog comments powered by Disqus