js_object_playground is a small project to practice creating JS objects.
To create a new Performance
object, pass it a venue name, a Date
object (with year, month, day, hours and minutes) and the compensation as an integer:
var date = new Date(2015, 10, 7, 20, 30);
var performance = new Performance('Paramount', date, 350);
There are several methods available on a Performance
object, including:
toString()
- returns a nicely formatted string describing the venue, date and compensation properties
paysEnough()
- Returns
false
if thePerformance
instance pays less than $200 or starts before noon and pays less than $400 - returnstrue
otherwise
- Returns
changeVenue(newVenue)
- Updates the
venue
property
- Updates the
changeDate(newDate)
- Updates the
date
property (must be aDate
object)
- Updates the
changeCompensation(newCompensation)
- Updates the
compensation
property
- Updates the
- Fork It
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create new Pull Request
This README was edited at dillinger.io