logo
logo

Find Crypto by Name

Beginner

Find Crypto by Name

Write a function
findCryptoByName
that takes an array of cryptocurrency objects and a string name, and returns a Promise that resolves to the first cryptocurrency object with a matching name. The cryptocurrency objects have a
name
property. For example,
findCryptoByName([{ name: 'Bitcoin', price: 50000 }, { name: 'Ethereum', price: 2000 }], 'Ethereum')
would return
{ name: 'Ethereum', price: 2000 }
.
Console
Submit
Solution
00:00