oder $myClass->myMethod();
Funktionen können natürlich auch Methoden haben, eingebaut sind u.a. apply, call und bind:
'use strict';
var f = function() { alert(this); }
f(); // undefined
f.call({ foo: 'bar' }); // [object Object]
f.apply({ foo: 'bar' }); // [object Object]
var f1 = f.bind({ foo: 'bar' });
f1(); // [object Object]
Das wird ständig in der objektorientierten wie der funktionalen JS-Programmierung verwendet (Stichworte: Method Binding, Currying/Partial Application, Higher-order Functions).
Siehe Bibliotheken, die Function.prototype erweitern:
http://api.prototypejs.org/language/Function/
http://sugarjs.com/api/Function
Und die Lodash-Funktionen für Funktionen:
http://lodash.com/docs (links zu »Functions« scrollen)
Siehe auch:
Function Binding
Function.prototype
apply
call
bind
Mathias