Steven Noble Steven Noble - 5 months ago 35
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?


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.