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

194
Vistas
Is there a way to create a specific instance of SmileyFace, and pass the name of that as the argument to drawSmiley()

var faceObj = {
    centerX: 100, 
    centerY: 100
};

var drawSmiley = function(faceObj) {
    fill(168, 124, 70);
    ellipse(faceObj.centerX, faceObj.centerY, 150, 150);
    fill(0, 0, 0);
    ellipse(faceObj.centerX-30, faceObj.centerY-30, 20, 20); 
    ellipse(faceObj.centerX+30, faceObj.centerY-30, 20, 20); 
    noFill(); 
    strokeWeight(3);
    arc(faceObj.centerX, faceObj.centerY+10, 64, 40, 0, 180);
};

var SmileyFace = function(x, y) {
    this.centerX = x;
    this.centerY = y;
};

//SmileyFace.speak('hello!');

var faceObj = new SmileyFace(this.centerX, this.centerY);
drawSmiley(SmileyFace);

var faceObj = new SmileyFace(100, 100);

How do I answer this statement while still maintaining this code? "You’re passing the name of the object (SmileyFace) as the argument when you call drawSmiley(). Instead, create a specific instance of SmileyFace, and pass the name of that as the argument to drawSmiley()."

about 4 years ago · Juan Pablo Isaza
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