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
Already tried a lot of things.
How To get the value of particular property?
Here is the JSON FILE.
[{“ id”:1“ bookname”:“ Physics”,“价格”:600,“ author”:“ ABC”,“页面”:567,“类别”:“科学”}
]
const { price } = book1;