What real purpose does $.noop() serve in jQuery 1.4?

前端 未结 9 761
故里飘歌
故里飘歌 2020-12-30 19:01

Pouring over the release notes regarding jQuery 1.4, I came acrosss $.noop() which is:

Description: An empty function. (added in 1.4)

9条回答
  •  臣服心动
    2020-12-30 19:17

    If a function requires you pass a function as an argument maybe? It's shorter to say do_something($.noop) than do_something(function(){}).

    Although not by much...

    ...6 characters...

    ...yeah, that feature looks quite useless actually.

提交回复
热议问题