课程: JavaScript: Five Advanced Challenges and Concepts
免费学习该课程!
今天就开通帐号,24,700 门业界名师课程任您挑!
Advanced solution: Stock information - JavaScript教程
课程: JavaScript: Five Advanced Challenges and Concepts
Advanced solution: Stock information
(upbeat music) - [Instructor] In the answer code for this challenge, you start with a generic Observable class. This class can be extended to quickly sign up observable objects, and it's a prototype for a reactive objects pattern which we'll cover in the next chapter. To solve this challenge, we have to build out a series of new classes and objects that either observe each other or are observed, and if you want to reference to which classes we need to build, you can go down here and look in the test code and you'll see which classes are called and what methods exist within those classes. The purpose of this challenge is to create a stock monitoring system where every time a stock changes in price, we'll get information about the price change, whether the price changes within a certain threshold, and what percentage the price change was. We'll start the process by building out the Stock class. The Stock class is the…