const book1 = this.state.books[0]; //giving one book
console.log(book1); //output->{id: 1, bookname: "Physics", price: 600, author: "ABC", pages: 567, …}
const {id,bookname,price,author,pages,category} = {book1};
console.log(price); //output->undefined
Я уже много чего перепробовал. Как узнать стоимость конкретной недвижимости? Вот файл JSON:
[
{
"id": 1,
"bookname": "Physics",
"price": 600,
"author": "ABC",
"pages": 567,
"category" : "Science"
}
]