As a c# coder learning JavaScript I find this alot more readable:
$(this)
.first()
.prepend("<h3>Title</h3>")
.end()
.removeClass("hidden");
than this:
$(this).first().prepend("<h3>Title</h3>").end().removeClass("hidden");
However JSLint complains about the first one. But I don´t understand why. Will this get me into trouble anywhere?
Update: You can set the value of indentation at the bottom of the jslint page and thereby make your code "valid". There is a fork of JsLint, http://www.jshint.com/, that accepts tabs as well.
The issue with that code on jsLint is due to the identation: if you indent it with 4 spaces there're no errors
(scroll down to the options and change identation settings if default value is not what you want)
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