{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreibq3pg35exkb5t5iodnwsftzzjxzd4gr7h7ume75ffnudiwh2g4oe",
"uri": "at://did:plc:vyjlfm46mfv6u4vjp6qtrfx2/app.bsky.feed.post/3mhe3pmq332s2"
},
"coverImage": {
"$type": "blob",
"ref": {
"$link": "bafkreidg2k33tiuupnstmiowh7hyyvtsbe3gyhfygiytrzynysnhoctrxi"
},
"mimeType": "image/jpeg",
"size": 81260
},
"path": "/articles/greater-than-false",
"publishedAt": "2026-03-18T06:30:00.000Z",
"site": "https://thedailywtf.com",
"tags": [
"Representative Line",
"Download Free Guide Now!"
],
"textContent": "Today's anonymous submitter passes us a single line of JavaScript, and it's a doozy. This line _works_ , but that's through no fault of the developer behind it.\n\n\n {arr?.length && shouldNotShow === false > 0 (...)}\n\n\nPedantically, this is JSX, not pure JavaScript, but the rules still apply.\n\nSo, fun fact in JavaScript: `true > 0` is true, and `false > 0` is false. Which generally makes sense, but why would you use that here? But this code is worse than it looks, thanks to operator precedence.\n\nThe highest precedence operation is the optional chain- `arr?.length`. The second highest operation? `>`. So the first part of the comparison that evaluates is `false > 0`. Which is false. Do you know what's next? `===`. So we compare `shouldNotShow` to `false`. Then we `&&` that with the potentially falsy value from our `arr?.length`.\n\nIt's all a mess, and it's all so we can compare against false, which we could have just done with a `!` operator. `!(arr?.length && shouldNotShow)`.\n\nOur submitter credits this to an offshore team, and this does have the vibe of throwing characters at the problem until it passes the test. Less LLM-guided and more \"manually executed Markov chain\". That's also an accurate description of the rest of the code in this code base: hand crafted Markov chain generation.\n\n[Advertisement] **Plan Your .NET 9 Migration with Confidence**\nYour journey to .NET 9 is more than just one decision.Avoid migration migraines with the advice in this free guide. **Download Free Guide Now!**",
"title": "Representative Line: Greater Than False"
}