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

185
Visualizações
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 à 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