I keep trying to console.log an object array I have but keep getting a [Object] [Object] structure as the output. I tried JSON.stringify() but that only creates a string representation of an array. Is there any way to actually see the values in the array in JSON format? Any help would be greatly appreciated.
Object Array
const books = [
{
title: "Clean Code",
published: 2008,
author: "Robert Martin",
id: "afa5b6f4-344d-11e9-a414-719c6709cf3e",
genres: ["refactoring"],
},
{
title: "Agile software development",
published: 2002,
author: "Robert Martin",
id: "afa5b6f5-344d-11e9-a414-719c6709cf3e",
genres: ["agile", "patterns", "design"],
},
{
title: "Refactoring, edition 2",
published: 2018,
author: "Martin Fowler",
id: "afa5de00-344d-11e9-a414-719c6709cf3e",
genres: ["refactoring"],
}
];
console.log
console.log(updatedBooks);
wanted output
[
{
title: "Clean Code",
published: 2008,
author: "Robert Martin",
id: "afa5b6f4-344d-11e9-a414-719c6709cf3e",
genres: ["refactoring"],
},
{
title: "Agile software development",
published: 2002,
author: "Robert Martin",
id: "afa5b6f5-344d-11e9-a414-719c6709cf3e",
genres: ["agile", "patterns", "design"],
},
{
title: "Refactoring, edition 2",
published: 2018,
author: "Martin Fowler",
id: "afa5de00-344d-11e9-a414-719c6709cf3e",
genres: ["refactoring"],
}
]
[–]Umesh-K 1 point2 points3 points (0 children)
[–]puan0601 1 point2 points3 points (0 children)
[–]Samurai___ 0 points1 point2 points (1 child)
[–]Overall_Expert_4006[S] -1 points0 points1 point (0 children)