Steven Noble Steven Noble - 11 months ago 61
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.