Implied global var

Posted in JavaScript by Marco Dias Lopes
Compatibility:

If you use “Chain assignment” or are considering using it, beware of implied globals. Take this example:

function vars()
{
	var a = b = "hello";
	console.log("a: " + a); // outputs: a: hello
}
vars();
console.log("b: " +  b); // outputs: b: hello
console.log("a: " +  a); // error not defined