Skip to content

Instantly share code, notes, and snippets.

@CraigMorton
Created September 23, 2016 09:12
Show Gist options
  • Save CraigMorton/a9e44ace2b3c9f6b2953e5ef51d73074 to your computer and use it in GitHub Desktop.
Save CraigMorton/a9e44ace2b3c9f6b2953e5ef51d73074 to your computer and use it in GitHub Desktop.

JS Record Store

Learning Objectives

  • Implement an OO JS program using the 'new' keyword
  • Practice adding methods to objects
  • Using JS data structures and loops
  • Practice building a TDD program from scratch

Requirements

  • Create a constructor to create Record objects with artist, title, price
  • Create some new records
  • Create a RecordStore that has a name, city and multiple records in it's inventory
  • Give the RecordStore a balance i.e. cash in bank.
  • Add some records to your RecordStore.
  • Create a method that lists the inventory.
  • Create a method so that the RecordStore can sell a record. Adjust the cash in bank to take into account the price of the record sold
  • Create a method that reports on the financial situation of the store. Cash and value of inventory.
  • Create a RecordCollector (or customer) constructor who can buy and sell records.
  • If you choose to, you can use lodash for enumerable functionality.
  • Use TDD all the way through!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment