Shorthand for empty function in Node.js

In JS, there is shorthand for an empty object which is {}. Is there shorthand for an empty function in JS?

The reason being, as functions are first-class objects, we use them as arguments more often, but passing in an empty function is at best ugly.

var foo = baz(function(){});

In order to declare a function, at somepoint we have to declare function(){}.

I would like more Node.js APIs to require a (callback) function to be passed, so the API doesn’t deceivingly look synchronous. Perhaps one step in that direction would be to create shorthand for empty placeholder functions.

46 thoughts on “Shorthand for empty function in Node.js”

  1. Pingback: keto sauces
  2. Howdy, i read your blog from time to time and i own a similar one and i was
    just wondering if you get a lot of spam responses?
    If so how do you stop it, any plugin or anything you can suggest?
    I get so much lately it’s driving me crazy so any assistance is very much appreciated.

  3. Nice blog right here! Also your site loads up fast! What web
    host are you the usage of? Can I am getting your affiliate hyperlink to your host?
    I wish my website loaded up as quickly as yours lol

  4. Hi there! This blog post couldn’t be written any better!
    Looking through this post reminds me of my
    previous roommate! He continually kept preaching about
    this. I will forward this post to him. Pretty sure he’ll have a very good read.
    I appreciate you for sharing!

  5. Appreciating the commitment you put into your blog and detailed information you present.
    It’s good to come across a blog every once in a while that isn’t
    the same out of date rehashed information. Fantastic read!
    I’ve bookmarked your site and I’m including your RSS feeds to my Google account.

  6. Pingback: nolvadex to buy
  7. Pingback: aralen 300 mg
  8. Pingback: buy lumigan
  9. Pingback: molnupiravir buy
  10. Pingback: zanaflex drug

Leave a Comment