(function () { ... }).call(animals[i], i) calls the function (function () { ... }) "on" the object animals[i] (that is: within the scope of the call, this will be animals[i]), with the argument i.

In other words, it's equivalent to this:

animals[i].f = function () { ... };
animals[i].f(i);

except without having to set animals[i].f.

Answer from ruakh on Stack Overflow
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Function › call
Function.prototype.call() - JavaScript - MDN Web Docs
Normally, when calling a function, the value of this inside the function is the object that the function was accessed on. With call(), you can assign an arbitrary value as this when calling an existing function, without first attaching the function to the object as a property.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › WebAssembly › Reference › Control_flow › call
call: Wasm text instruction - WebAssembly - MDN Web Docs
November 23, 2025 - call calls a function, return_call being the tail-call version of it. call_indirect calls a function in a table with the return_call_indirect tail-call version as well.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › API › WebRTC_API › Build_a_phone_with_peerjs › Connect_peers › Creating_a_call
Creating a Call - Web APIs | MDN
June 23, 2025 - When a caller clicks "Call" you'll want to ask them for the peer ID of the peer they want to call (which we will store in the code variable in getStreamCode()) and then you'll want to create a connection with that code.
🌐
reading-notes
clementbuchanan.github.io › reading-notes › 301Class10.html
The Call Stack defined on MDN | reading-notes - GitHub Pages
A call stack is a mechanism for an interpreter (like the JavaScript interpreter in a web browser) to keep track of its place in a script that calls multiple functions — what function is currently being run and what functions are called from within that function, etc.
🌐
Reality Ripple
udn.realityripple.com › docs › Web › JavaScript › Reference › Global_Objects › Function › call
Function.prototype.call() - JavaScript
The call() method calls a function with a given this value and arguments provided individually. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples ...
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Function › apply
Function.prototype.apply() - JavaScript - MDN Web Docs
July 10, 2025 - Normally, when calling a function, the value of this inside the function is the object that the function was accessed on. With apply(), you can assign an arbitrary value as this when calling an existing function, without first attaching the function to the object as a property.
🌐
Stack Overflow
stackoverflow.com › questions › 63229136 › understanding-mdn-function-syntax-using-function-prototype-call-as-an-example
Understanding MDN function syntax using Function.prototype.call as an example
Using this page as an example, I want to understand entirely the syntax MDN uses here: I know that things in brackets are 'optional'. Does ...argN generally mean unlimited amount of arguments? Why are the brackets and commas written on the wrong side of each other? Wouldn't it be better if it were just: func.call([thisArg], [arg1], [arg2], [...argN])?
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Glossary › Call_stack
Call stack - Glossary - MDN Web Docs
July 11, 2025 - A call stack is a mechanism for an interpreter (like the JavaScript interpreter in a web browser) to keep track of its place in a script that calls multiple functions — what function is currently being run and what functions are called from within that function, etc.
Find elsewhere
🌐
DEV Community
dev.to › thesanjeevsharma › call-apply-and-bind-in-javascript-2nno
call(), apply() and bind() in Javascript - DEV Community
September 27, 2021 - According to MDN: The call() method calls a function with a given this value and arguments provided individually. In simple terms, you decide what will be this inside a function when calling it. Let's understand this with a very simple example.
Top answer
1 of 3
3
  1. Why doesn't it need to be invoked? — because, as you say, it's a reference, and that's all that's desired. The code wants a reference to the function, not a result returned from calling the function.

  2. Is JS 'seeing' the call method chained to slice and then trying to resolve a value to pass to slice from the call(arguments) method? — well I'm not sure what that means. The reference to the .slice() function is used to get access to the .call() method (inherited from the Function prototype). That function (slice.call) is invoked and passed the arguments object as its first parameter. The result is that slice will be invoked as if it were called like arguments.slice() — which is not possible directly, as the .slice() function isn't available that way.

Overall, what the code is doing is "borrowing" the .slice() method from the Array prototype and using it as if the arguments object were an array.

Sometimes you'll see that written like this:

return [].slice.call(arguments);

It's a little shorter, and it does the same thing (at the expense of the creation of an otherwise unused array instance).

2 of 3
3

call in javascript is a way of invoking a method within the function, which hard binds the context of this within a function to the parameter passed to it..For more detail regarding callgo through the link below

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/call

If you want to know more about this and why call is being used, I highly recommend you to go through this github repo:

https://github.com/getify/You-Dont-Know-JS/blob/master/this%20&%20object%20prototypes/ch1.md

Secondly, by default every regular function expression in JS has an arguments object, which is an iterable which is nothing but the list of parameters passed to that function.

function foo()
{
console.log(arguments); //1,2
}
foo(1,2)

More about arguments

https://www.google.co.in/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=arguments%20in%20javascript

And if you want to learn JS properly, blindly go through this repo:

https://github.com/getify/You-Dont-Know-JS

🌐
Can I Use
caniuse.com › mdn-javascript_builtins_function_call
JavaScript built-in: Function: call | Can I use... Support tables for HTML5, CSS3, etc
"Can I use" provides up-to-date browser support tables for support of front-end web technologies on desktop and mobile web browsers.
🌐
Medium
medium.com › @ankur_anand › implement-your-own-call-apply-and-bind-method-in-javascript-42cc85dba1b
Implement your own — call(), apply() and bind() method in JavaScript | by Ankur Anand | Medium
May 4, 2020 - So If you look carefully the argument “Mr” was provided at the time of creating a bound function bindFullName while argument “Ankur” was provided at the time of invoking the bindFullName which in turn invokes the target function. So the argument “Mr” was prepended to the arguments list when we called the bindFullName with an argument “Ankur”. This is what the definition at the MDN for args1, args2, ...
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Functions › Arrow_functions
Arrow function expressions - JavaScript - MDN Web Docs
February 21, 2026 - For similar reasons, the call(), apply(), and bind() methods are not useful when called on arrow functions, because arrow functions establish this based on the scope the arrow function is defined within, and the this value does not change based on how the function is invoked.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Function › caller
Function.prototype.caller - JavaScript - MDN Web Docs
July 10, 2025 - The caller accessor property of Function instances returns the function that invoked this function. For strict, arrow, async, and generator functions, accessing the caller property throws a TypeError.
🌐
freeCodeCamp
freecodecamp.org › news › how-to-use-the-apply-call-and-bind-methods-in-javascript-80a8e6096a90
How to use the apply(?), call(?), and bind(➰) methods in JavaScript
March 8, 2019 - As functions are objects in JavaScript, ... apply, call, and bind methods. To check if a function is a Function object, we can use the code in the following snippet, which returns true. The global Function object has no methods or properties of its own. However, since it is a function itself, it does inherit some methods and properties through the prototype chain from Function.prototype. — MDN...
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Function › bind
Function.prototype.bind() - JavaScript - MDN Web Docs
Calling the bound function generally results in the execution of the function it wraps, which is also called the target function. The bound function will store the parameters passed — which include the value of this and the first few arguments — as its internal state.