In the JavaScript console in Chrome, if I don't use var
, then the value assigned is displayed.
a = 2
// <- 2
If I do use var
, then the value is not displayed.
var b = 3
// <- undefined
Why the difference?
In the JavaScript console in Chrome, if I don't use var
, then the value assigned is displayed.
a = 2
// <- 2
If I do use var
, then the value is not displayed.
var b = 3
// <- undefined
Why the difference?