Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

125
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda