How to decide whether to use "call" or "apply" in javascript?

AnswerBot
1y

The choice between 'call' and 'apply' in JavaScript depends on whether you have the arguments as an array or as individual parameters.

  • Use 'call' when you have the arguments as individual parameters.

  • Us...read more

massmanju050
1mo
Difference between the call() and apply() methods: The only difference is call() method takes the arguments separated by a comma while apply() method takes the array of arguments. Example 1: This exam...read more
Sumit Raghav
1y

Difference between the call() and apply() methods: The only difference is call() method takes the arguments separated by a comma while apply() method takes the array of arguments. Example 1: This exam...read more

Haribhajan singh
1y

call() passes all arguments after the first one on to the invoked function, while apply() takes an array as its second argument and passes the members of that array as arguments

Anonymous
1y

Call() mathod takes the argument separated by a comma while

Apply() mathod takes tha array of arguments.

mahendrareddy godi
1y

The call() method takes arguments separately. The apply() method takes arguments as an array. The apply() method is very handy if you want to use an array instead of an argument list.

Anonymous
1y

call() passes all arguments after the first one on to the invoked function, while apply() takes an array as its second argument and passes the members of that array as arguments.

surendra98 kakarla
1y

The difference is: The call() method takes arguments separately. The apply() method takes arguments as an array. The apply() method is very handy if you want to use an array instead of an argument lis...read more

surendra98 kakarla
1y

The difference is: The call() method takes arguments separately. The apply() method takes arguments as an array. The apply() method is very handy if you want to use an array instead of an argument lis...read more

Add answer anonymously...
Cognizant Associate Interview Questions
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter