JavaScript object.method() and Function literal