I was going through one Backbone.js
plugin in which I found the below piece of code.
callbacks : {
search : $.noop,
valueMatches : $.noop
}
What is the $.noop()
function doing here?
$.noop
is an empty function so in your case it's returning an empty function
You can use this empty function when you wish to pass around a function that will do nothing.
This is useful for plugin authors who offer optional callbacks; in the case that no callback is given, something like jQuery.noop could execute.
Documentation found here : http://api.jquery.com/jquery.noop/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With