logo
logo

Crypto Watchlist

Beginner

Crypto Watchlist

Create an object constructor named
Watchlist
that takes in the following parameter:
name
. It should return an object with this property. Add a method named
addCurrency
to the
Watchlist
prototype object that adds a new cryptocurrency object with a
name
,
symbol
, and
price
property to an array of currencies. Add a method named
getTotalValue
to the
Watchlist
prototype object that calculates the total value of all currencies in the watchlist based on their quantity. For example,
getTotalValue()
would return the total value of all currencies in the watchlist based on their quantity and current price.

Console
Submit
Solution
00:00