I just ran one script through JSlint and received tons of errors – all related to the example below. Now I need to clear some basics, as I’m honestly pretty new to JS and don’t know if those are “critical” Errors, Warnings or notices.
var whatEver = {
foo: null,
fooArray: [],
// This tells me that the curly bracket was expected much earlier
barArray:
{
whatever: 'somestring'
,keyTwo: 'anotherstring'
},
// Here I get told that I got "wrong" white spaces
bar: document.getElementById( 'someID' )
};
I know most of this is “basic” js stuff and so far everything’s working fine. I just want to know if I’m making basic mistakes.
Thanks.
Here is some feedback:
Here’s what I’d go with. http://jsfiddle.net/n87Cn/ JSLINT doens’t like it, but I think it’s quite nice.