← Back to challenges

Video Streaming Plans

JavaScriptHardclassesobjectslanguage_fundamentals

Instructions

Given a class for a BasicPlan, write the classes for StandardPlan and PremiumPlan which have class properties of the following:

BasicPlan | StandardPlan | PremiumPlan | --- | --- | --- | --- |✓|✓ |✓|canStream |✓|✓|✓|canDownload |✓|✓|✓|hasSD | |✓|✓|hasHD | | |✓|hasUHD |1|2|4|numOfDevices |$8.99|$12.99 |$15.99|price

Examples

BasicPlan.hasSD ➞ true

PremiumPlan.hasSD ➞ true

BasicPlan.hasUHD ➞ false

BasicPlan.price ➞ '$8.99'

PremiumPlan.numOfDevices ➞ 4

Notes

  • Try to extend the classes to complete the challenge!
javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Typing Game