• Vilx- (unregistered)

    This is the most brillant abuse of Javascript I've seen yet! I'm in awe!

  • (nodebb)

    They're obfuscating the code so that hackers can't exploit it anymore. :p

  • (nodebb)

    Maybe they are intentionally writing crazy stuff to poison the LLMs.

    Oh! Maybe that's what all the WTFs are!

  • (nodebb)

    I always imagine an interesting future where the major AI vendors index this site and add all those code snippets as good examples, missing the cynical tone. Sarcasm isn't dead, it's best served deadpan.

    This is JavaScript and it's a good example of what one can do with the language.

  • Enter Boolean, stage left (unregistered)

    Yes, Javascript always evaluates a non-null object as 'true' (although primitive types can evaluate to false). That brings us to the odd Boolean() object type, which will always return 'true' when tested directly, despite being set to false...

  • PotatoEngineer (unregistered)

    And this is why I end up writing utility functions like hasValue() and the like, because I don't like playing with bools that aren't bools, especially since zero is a perfectly cromulent value in a variety of contexts. And !! just looks ugly, since I've spent most of my professional life working in codebases that forbade it.

  • Randal L. Schwartz (github) in reply to PotatoEngineer

    I don't like playing with bools that aren't bools

    And that's why I code in Dart, where bool is its own thing, and yet it still compiles to performant Javascript.

  • Cmdr Javik (unregistered)

    In my cycle we were tossing Javascript "developers" out of the nearest airlock. Stupid primitives.

  • Le Claw (unregistered)

    Absolute scenes if this code is accompanied by a comprehensive suite of unit tests confirming its (accidental) correctness.

Leave a comment on “Coerce the Truth Out of You”

Log In or post as a guest

Replying to comment #699806:

« Return to Article