As a C # encoder learning JavaScript, I find this 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. But I do not understand why. Will it bother me anywhere?
Update:
You can set the indent value at the bottom of the jslint page and thereby make your code "valid". There is a JsLint plug, http://www.jshint.com/ , which also accepts tabs.
source
share