Help with jQuery. Can't output text to a web page [Solved]

Hi clever people of FCC,
I have here a very simple array, which I want to .text() on the page, but only get
[object Object], [object Object], [object Object]

What am I doing wrong? here is my project:

Thank you so much in advance!


Hey, you can’t .text() an object. You can loop through the array and use dot notation (or bracket notation) to acces properties of the object:

var text = "";

  text += el.firstName + " ";
  text += el.lastName;
  text += "<br />";


Or if you just want to see al the properties, use this forEach loop:

  text += JSON.stringify(el);

But if it is only for checking, you might want to use the console.

Hi Ben,

thanks a lot. It works!