I was going through some of StackOverflow’s client side code and I ran across this block of JavaScript in the source-code of https://stackoverflow.com/questions/ask:
if ($answerCheckbox.is(':checked') || 0 > 0) {
$answerCheckbox.attr('checked', true);
$('#question-only-section').hide();
StackExchange.using("editor", function () {
setTimeout(function () { showAnswerSection(true) }, 2);
});
}
Why wouldn’t you use false instead?
You’re assuming the code is all natively written Javascript. It isn’t uncommon to see some server-generated script which references elements via some programmatic identifier which resolves like this at runtime, which admittedly looks a little peculiar.