Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

jQuery.noop() method

jQuery.noop() method

jQuery Miscellaneous MethodsjQuery Miscellaneous Methods

Example

Pass an empty function as an argument and return an empty array

$

(

function

(

)

{

var

result

= $.

map

(

[

1

,

2

,

3

]

, $.

noop

)

;

document

.

writeln

(

result

.

length

)

;

//

0

}

)

Try it »


Definition and Usage

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

**Note: This method accepts no arguments.** For example, when a plugin provides an optional callback interface, if no callback is passed at call time, $.noop is used instead.


Syntax

$

.noop()

jQuery Miscellaneous MethodsjQuery Miscellaneous Methods