logo
logo

Crypto Coin Constructor

Crypto Coin Constructor

Create a constructor function called CryptoCoin that takes in a name and a price. The class should have a method called getPrice that returns the price of the coin. For example,
new CryptoCoin('Bitcoin', 55000).getPrice()
should return 55000.
Console
Submit
Solution
00:00