Facebook Pixel

What is the difference between call and apply arguments?

call takes comma-separated arguments: fn.call(obj, arg1, arg2). apply takes an array: fn.apply(obj, [arg1, arg2]). Both invoke immediately with the specified this.

Verify This Answer

Cross-check this information using these trusted sources:

More FAQs in Common Mistakes with call, apply, and bind

No. bind returns a new function with this bound. You must call it separately. This is the key difference from call and apply, which invoke immediately.

No. The first bind wins. bound.bind(newObj) does not change this. The bound function keeps the original this from the first bind call.

No. Arrow functions inherit this from their lexical scope. bind, call, and apply cannot change an arrow's this. They can still pass arguments, but this stays lexical.

Still have questions?

Browse all our FAQs or reach out to our support team

Want to upskill yourself?

Our courses are taking a Coffee break, but your curiosity shouldn't. Stay engaged with namastedev linkedin, youtube, discord and other resources while you wait.

0
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.