0

I have this code....

let test = [
    {
        title: "title1",
        answer: "answer1"
    },
    {
        title: "title2",
        answer: "answer2"
    },
    {
        title: "title3",
        answer: "answer3"
    },
];

and I'm trying to get the first title for example, but when I do console.log(test[0]); I get the whole object.

How can I select only the title?

Nick Parsons
  • 45,728
  • 6
  • 46
  • 64

0 Answers0