Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
18 lines (10 sloc) 401 Bytes
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.