After some googling and testing I came up with the following test document (which is perfectly valid HTML5 btw!):
foobar(), which simply shows a 'hello' alertbox. Then I redefined that same method to first display another alert, and then call the original function, which will still show the 'hello' alertbox.
While the example is not very useful, this technique could be useful to redefine a method of some framework to attach custom logic (such as logging) without having to …