JSFiddle - React, Tailwind, and code Playground

by godwin gabriel

JavaScript

let arr = [
{price: 5, qty: 3}, {price: 2, qty:4}
]

let final = arr.reduce((acc,curr)=>{
	return acc + (curr.price * curr.qty)
},0)

console.log(final)
document.write = final