Friday, January 10, 2014

a JSLint example

JSLint prodded me to clean up this:

var foo = new Object();
foo["bar"] = "baz";
alert(foo["bar"]);

 
 

...to this:

var foo = {};
foo.bar = "baz";
alert(foo.bar);

 
 

...but still complained of this:

'alert' was used before it was defined.

 
 

#sadtrombone

No comments:

Post a Comment