wrapping an existing function with another function

wrapping an existing function with another function

Hey folks,

A question for a jQuery expert.

I'm more familiar with Prototype, but I've been using jQuery a lot recently and needed to find out how something is done, jQuery style...

Prototype has a rather handy wrap() function which lets you wrap an existing function within another function. It lets you attach code to be executed before or after an existing function is called.
http://prototypejs.org/api/function/wrap

How can this be done with jQuery?

- Ben