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

前端 未结 9 738
故里飘歌
故里飘歌 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:18

    It's purely a convenience/replacement for function(){} in the context of where callbacks are required - I don't think I'll be using it anytime soon.

    I bet the jQuery team had quite a laugh when they dropped it in though, also serves a comedic purpose.

提交回复
热议问题