Suppose I have an array of object as,
const BookDetails = [
{ bookName: 'Harry Pottar', readingTime: 10663 },
{ bookName: 'Harry Pottar', readingTime: 10986 },
{ bookName: 'kaptura Tech', readingTime: 7034 }
]
For this I tried solution as,
const avgInvoiceProcessingTime = Math.round(((readingTime.map(a => a.Time).reduce((a, b) => a + b, 0) / 1000)));
But it doesnot give average.
I want to count all the readingTime and divide by length of BookDetails array, but having trouble adding all the reading time.