I've been using javascript & jQuery for a month. But I am still not getting what is the difference between using var
variable and without declaring var
.
var data = 10;
data = 10;
What is difference between the two statements above? And why? Please explain to me in detail.