Steven Noble Steven Noble - 1 year ago 75
Javascript Question

Is there a JavaScript (or jQuery) shortcut for "function(){return false;}"?

To prevent actions from happening, I frequently type

function(){return false;}

Is there a shortcut?

Answer Source

You could declare a named function like this:

function always_false() { return false; }

then use always_false() wherever you would have previously created the anonymous function.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download