1var someObject = {
2myProperty : 'Foo',
3
4myMethod : function(prefix, postfix) {
5
6 alert(prefix + this.myProperty + postfix);
7}
8};
9someObject.myMethod('<', '>'); // alerts '<Foo>'
10var someOtherObject = {
11
12 myProperty : 'Bar.'
13
14};
15someObject.myMethod.call(someOtherObject, '<', '>'); // alerts '<Bar>'
16
17someObject.myMethod.apply(someOtherObject, ['<', '>']); // alerts '<Bar>'
18