VOOZH about

URL: https://www.geeksforgeeks.org/javascript/underscore-js-_-bindall-function/

⇱ Underscore.js _.bindAll() Function - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Underscore.js _.bindAll() Function

Last Updated : 13 Jul, 2022

BindAll() function in underscore.js is used to bind the number of methods on the object. Each method is given a method name. It is handy to work with the event handlers.

Syntax: 

_.bindAll(object, *methodNames)

Parameters:

  • Object: It is the object that contains different methods and functions to be bind.
  • methodNames: It is the names of methods present in  the object.

Return Value: It returns nothing.

Note: Please Link the underscore CDN before using this code directly in the browser through the code.

Example 1:

Output:

👁 Image

Example 2:

Output:

👁 Image

Comment