Flutterby™! : JavaScript idioms

Next unread comment / Catchup all unread comments User Account Info | Logout | XML/Pilot/etc versions | Long version (with comments) | Weblog archives | Site Map | | Browse Topics

JavaScript idioms

2023-09-13 20:00:17.639384+02 by Dan Lyke 0 comments

RT Greg Knauss @gnkauss@mastodon.social

Since I’m new to JavaScript, I wrote:

    𝚒𝚏 (𝚌𝚊𝚕𝚕𝚋𝚊𝚌𝚔) { 𝚌𝚊𝚕𝚕𝚋𝚊𝚌𝚔(); }

…like an idiot. Then, I realized I should be adapting to JavaScript culture and make it inscrutable, so I re-wrote the line to:

    𝚌𝚊𝚕𝚕𝚋𝚊𝚌𝚔 && 𝚌𝚊𝚕𝚕𝚋𝚊𝚌𝚔();

But I suspected there was something even more nightmarish, and sure enough, of course. This is how real[Wiki] JavaScript developers do it:

    𝚌𝚊𝚕𝚕𝚋𝚊𝚌𝚔?.();

And by “real JavaScript developers,” I mean “monsters”.

[ related topics: Invention and Design moron Sociology California Culture ]

comments in ascending chronological order (reverse):

Comment policy

We will not edit your comments. However, we may delete your comments, or cause them to be hidden behind another link, if we feel they detract from the conversation. Commercial plugs are fine, if they are relevant to the conversation, and if you don't try to pretend to be a consumer. Annoying endorsements will be deleted if you're lucky, if you're not a whole bunch of people smarter and more articulate than you will ridicule you, and we will leave such ridicule in place.


Flutterby™ is a trademark claimed by

Dan Lyke
for the web publications at www.flutterby.com and www.flutterby.net.