Test case details

Preparation Code

<script> var a = [1, 2, 3]; var b = []; var obj = { foo: function () { var len = arguments.length; return this.bar; }, bar: 'baz' }; </script>

Test cases

Test #1

obj.foo(1, 2, 3);

Test #2

obj.foo.apply(obj, a);

Test #3

obj.foo.call(obj, 1, 2, 3);

Test #4

obj.foo.call(obj, a[0], a[1], a[2]);

Test #5

obj.foo.call(obj, b[0], b[1], b[2]);