Canonset
← Samples

Preference data

Which answer is better, and why

Coding and agent-behavior comparisons chosen to test judgment, not just correctness: sometimes the longer answer is wrong, sometimes caution is the wrong call, and one pair is a genuine tie that should not be forced.

  • 12 pairs
  • 10 clear, 2 slight or tie
  • Agent safety and honesty cases
  • Raw and DPO formats

Why [] == false in JavaScript

pref-05

Prompt

Why does [] == false evaluate to true in JavaScript?

Response A

Because == converts both sides before comparing. false becomes 0. The array becomes a primitive: [].toString() is "", and "" becomes 0. So the comparison is 0 == 0, which is true. Note that [] itself is truthy (if ([]) runs), which is why == with booleans is confusing; use ===.

Response B

Because empty arrays are falsy in JavaScript, just like empty strings, so [] is treated as false.

Expert judgment

Prefers response AClear preference

B's central claim is false: `[]` is truthy. A explains the actual type conversions step by step and adds the practical fix.