Excuse my JS ignorance, but here's a question:
In JS, I've noticed functions that define variables inside them like this:
function functionName(){
this.something = "";
};
I'm wondering if something
is considered a local variable. Why is it declared as this.something = ''
instead of var something = ''
?
What exactly is the difference between these two declarations?