Passing function literal via event

Passing function literal via event

Am I able to pass a function literal (at least I think that's what it's called) to a jquery event handler, and retrieved the event details in the function? 

Like so:

  1. function doSomething(ev)
  2. {
  3.       alert(ev);
  4. }

  5. $(someElement).click(doSomething);


I think that's more efficient that the following, when registering events on a large number of elements, or am I wrong?:

  1. $(someElement).click(function()
  2. {
  3. doSomething($(this));
  4. });