logo
logo

Calculate Crypto Average Price

Beginner

Calculate Crypto Average Price

Write a function
calculateCryptoAveragePrice
that takes an array of cryptocurrency objects and returns a Promise that resolves to the average price of all the cryptocurrencies. The cryptocurrency objects have a
price
property.
For example,
calculateCryptoAveragePrice([{ name: 'Bitcoin', price: 50000 }, { name: 'Ethereum', price: 2000 }])
would return 26000.
Console
Submit
Solution
00:00