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

105
Vistas
Problems with displaying values of a property

So I'm trying to display the values of a book in myLibrary but the when I do it displays it like this :

  • Zero To one
  • Peter Thiel
  • 210
  • Has been read already
  • function() { return title + " " + "by" + " " + author + " " + pages + " " + "pages" + " " + isRead; }

It shouldn't display this part:

function() { return title + " " + "by" + " " + author + " " + pages + " " + "pages" + " " + isRead; }

Here's my code:

    this.pages = pages;
    this.isRead = isRead;
    this.info = function() {
        return title + " " + "by" + " " + author + " " + pages + " " + "pages" + " " + isRead;
    }
}

const zeroToOne = new Book("Zero To one", "Peter Thiel", "210", "Has been read already");

function addBookToLibrary(bookToAdd) {
    myLibrary.push(bookToAdd);
    console.log(myLibrary);
    for (let obj of myLibrary) {
        console.log(obj);
        card.textContent = Object.values(obj);
    }
}
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You have to call the info function :

console.log(obj.info());
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