Guia de entrevista · JavaScript

What is bind, call, apply?

do caderno de estudos · atualizado em 2 de outubro de 2026
Para quem vai encarar entrevista de JavaScript2 min

Parece simples até o entrevistador perguntar "why?". Abaixo, uma estrutura de resposta que dá conta do follow-up.

A resposta, como você fala na entrevista

For ordinary functions, these APIs let you supply a receiver and arguments.
call(): invokes immediately with arguments listed individually.
apply(): invokes immediately with an array or array-like argument list.
bind(): returns a new function with a receiver and optional leading arguments fixed for ordinary calls. It does not invoke it.

Trap: arrows ignore the supplied receiver. If a bound function is constructable, new boundFn() uses the new instance as this, ignoring the bound receiver.

Source: MDN bind.

Pegadinha clássica

Essa pergunta tem uma armadilha que derruba muita gente em entrevista. Ela está marcada na resposta acima: vale reler antes de treinar.

Ler é o primeiro passo. No app, essa pergunta vira flashcard com repetição espaçada, e o módulo tem quiz e simulado para testar o que ficou.

Treinar essa pergunta no app