Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

123
Visualizações
How these two lines of code performing exactly the same operation on the javascript object rect?

line1:

rect.setSize(height,widht)

line2:

setRectSize(rect,width,height)

The hypothetical functions invoked in these two lines of code may perform exactly the same operation on the (hypothetical) object rect.but the method invocation syntax in the first lines more clearly indicates the idea that it is the object rect that is the primary focus of the operation.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Assume rect is an instance of an object that has a method like

Rect.prototoype.setSize = function (h, w) {
    this.height = h;
    this.width = w;
}

rect.setSize(height, widht);

that's the same as doing

rect.height = height;
rect.width = widht;

Now the function

function setSize(rect, width, height) {
    rect.height = height;
    rect.width = width;
}
setSize(rect, width, height);

You can see it does the same thing

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda