Fury at Rachel Reeves' Brexit reversal as she calls for the UK to follow EU rules again
Broken-down train blocks lines between London and Essex
Broken-down train blocks lines between London and Essex
Burberry honours Queen Elizabeth II with new royal-inspired capsule - featuring corgi jewellery and iconic check scarves
Nvidia Announces Vera Rubin Space-1 Chip System For Orbital AI Data Centers
Read more of this story at Slashdot.
New recycling collections to be rolled out in Basildon
Representative Line: Greater Than False
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.
{arr?.length && shouldNotShow === false > 0 (...)}Pedantically, this is JSX, not pure JavaScript, but the rules still apply.
So, 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.
The 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.
It'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).
Our 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.
[Advertisement] Plan Your .NET 9 Migration with ConfidenceYour journey to .NET 9 is more than just one decision.Avoid migration migraines with the advice in this free guide. Download Free Guide Now!
Major queues on M25 after three-lorry serious crash in early hours of morning
Locals fighting plans for 2,000 homes on 'cherished' Essex farmland next to ancient woodland
The top ten places to eat in Essex this Easter - according to reviews
Six Essex schools currently looking to hire new headteachers
Essex village found in stunning National Landscape named one of the UK's best
The top ten places to eat in Essex this Easter - according to reviews
Plans for 11,000 new homes in Braintree district - council launches consultation
Six Essex schools currently looking to hire new headteachers
Essex village found in stunning National Landscape named one of the UK's best
CHRISTOPHER STEVENS on The author Len Deighton who has died aged 97: The master spy writer whose high-octane plots gripped 'like Princess Anne's jodhpurs'
Shirtless Shia LaBeouf sparks a scene in his underwear at hotel lobby in Rome after recent arrest
Linux Foundation kicks off effort to shield FOSS maintainers from AI slop bug reports
Half a dozen Big Tech players have together delivered $12.5 million in grants towards a project that aims to help maintainers of open source projects to cope with AI slop bug reports.…