Created
April 12, 2017 05:31
-
-
Save anonymous/23da0d317b3d5743695776b9215e141e to your computer and use it in GitHub Desktop.
6.5 Biller Builder created by smillaraaq - https://repl.it/HGIt/2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function biller(state){ | |
debugger; | |
if(state==="NY"){console.log("ny"); | |
var newYorkBiller=function(cost){ | |
var finalCost=((cost*1.03)*1.09).toFixed(2); | |
console.log(finalCost); | |
}; | |
return newYorkBiller; | |
}else{console.log("nj"); | |
var newJersBiller=function(cost){ | |
var finalCost=((cost*1.05)*1.07).toFixed(2); | |
console.log(finalCost); | |
}; | |
return newJersBiller; | |
} | |
} | |
var newYorkBiller = biller('NY'); | |
newYorkBiller(100) // => 112.27 | |
var newJersBiller = biller('NJ'); | |
newJersBiller(100) // => 112.35 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment