I dont know why reduce is not working on my code, im trying to add amount and item with reduce?

Viewed 14

Hi I can't make this code to concat to the total, I dont know why reduce is not working on my code, im trying to add amount and item with reduce

export const getBasketTotal = (basket) => {
        basket?.reduce((amount, item) => item.price + amount, 0)

}
0 Answers
Related