Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

18 lines (10 sloc) 0.401 kb
class TaxCalculator
constructor: (@tax = 10) ->
taxAmount: (price) -> price * (@tax/100)
totalPrice: (price) -> price + @taxAmount(price)
@isTaxableState: (state) ->
state in ['PA', 'MO', 'NY']
state = 'PA'
isTaxable = TaxCalculator.isTaxableState(state)
console.log "state #{state} is taxable? #{isTaxable}"
#isTaxable = if TaxCalculator.isTaxableState(state) then "yes" else "no"
Jump to Line
Something went wrong with that request. Please try again.