About 368,000 results
Open links in new tab
  1. Explain call(), apply(), and bind() methods in JavaScript

    Aug 20, 2024 · The bind(), call(), and apply() methods are fundamental concept in JavaScript for controlling function execution contexts. Understanding these methods—and knowing how to implement simple polyfills for them—enhances your grasp of …

  2. Function.prototype.apply() - JavaScript | MDN - MDN Web Docs

    Mar 13, 2025 · 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. This allows you to use methods of one object as generic utility functions.

  3. JavaScript Function apply() Method - W3Schools

    With the apply() method, you can write a method that can be used on different objects. The apply() method is similar to the call() method (previous chapter). In this example the fullName method of person is applied on person1: The difference is: The call() method takes arguments separately. The apply() method takes arguments as an array.

  4. Explain call() and apply() methods in JavaScript - GeeksforGeeks

    Mar 28, 2022 · JavaScript provides the call(), apply(), and bind() methods for setting the this context within a function. These methods are especially useful when working with object-oriented code or handling different function contexts.

  5. How to Use the Call, Apply, and Bind Functions in JavaScript – …

    Jun 20, 2022 · In this article, I am going to explain how to use call, apply, and bind in JavaScript with simple examples. We will also implement an example that showcases how you can create your own map function with the apply function.

  6. JavaScript: bind() vs apply() and call() - W3docs

    Read this JavaScript tutorial and learn about the main differences between the function prototype methods: bind (), call () and apply () and their usages.

  7. How to use the apply(?), call(?), and bind( ) methods in JavaScript

    Mar 8, 2019 · As functions are objects in JavaScript, their invocation is controlled by the 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 …

  8. Javascript call(), apply(), bind() methods & their polyfills

    Jan 30, 2022 · In this article, I'll be explaining the call, apply & bind methods & how to write their polyfills. These three polyfills are very commonly asked questions in a javascript interview. Let's get started with an example to understand the need of these methods & then we'll jump on their implementations.

  9. Decorators and forwarding, call/apply - The Modern JavaScript

    Jun 8, 2022 · There’s a special built-in function method func.call (context, …args) that allows to call a function explicitly setting this. The syntax is: func.call(context, arg1, arg2, ...) It runs func providing the first argument as this, and the next as the arguments. To put it simply, these two calls do almost the same:

  10. JavaScript Call, Apply & Bind methods | Medium

    Sep 26, 2023 · apply: Similar to call, the apply method invokes a function with a specified this value, but it takes an array or an array-like object as its second argument, allowing you to pass a variable...

  11. Some results have been removed
Refresh