Eclipse is complaining about my JavaScript code:
As fas as I can tell, the code is working fine. What do I have to change to get rid of the warning?
The semantic validator (despite it's failings, like this one) actually has a lot of uses. For instance, it can tell you when you've got a variable that's not being used anywhere (eg. because you have a typo in the variable's name).
If you don't want to see that error message, but you still want to keep semantic validation on, you can use this hack:
var textArray = 0 || [ ...
it's a little ugly, and your non-Eclipse-using co-workers may not like it, but at least it gives you a way to ditch the warning and still have the benefits of the validator.
A similar hack (if you don't like the first one, or if you're a big Douglas Crockford fan) that will also work is:
var textArray;
textArray = [ ...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With