jQuery.noop()Method

jQuery 杂项方法jQuery Misc Methods

Example

Pass an empty function as a parameter, and it returns an empty array

$(function () { var result = $.map( [1, 2, 3], $.noop ); document.writeln( result.length ); // 0 })

Try it Yourself »

Definition and Usage

The $.noop() function is an empty function.

Note: This method does not accept any parameters.For example, when a plugin provides an optional callback function interface, then if this callback is not passed when calling, use $.noop to execute instead.


Syntax

$.noop()

jQuery 杂项方法jQuery Misc Methods

Other Extensions