/openmrs-2023-interviews

Create an asynchronous function called trendingStocks that accepts an integer 'n' as an input. The function should return an array of 'n' objects, each object representing the top 'n' US-based stocks by market cap.

Primary LanguageJavaScript

US-based stocks by market cap.

  • Create an asynchronous function called trendingStocks that accepts an integer 'n' as an input. The function should return an array of 'n' objects, each object representing the top 'n' US-based stocks by market cap. Each object should have the following 6 properties: "name", "symbol", "price", "market-cap", "52-week-high", and "52-week-low". The objects should include the data of the top 'n' US-based stocks by market cap.

Screenshot of logs sample

  • Output

Question doc link