Skip to content

Instantly share code, notes, and snippets.

@AliceWonderland
Forked from anonymous/6.5 Biller Builder.js
Created April 12, 2017 05:31
Show Gist options
  • Save AliceWonderland/70c6610f485fc6388ce4d2e895e95794 to your computer and use it in GitHub Desktop.
Save AliceWonderland/70c6610f485fc6388ce4d2e895e95794 to your computer and use it in GitHub Desktop.
6.5 Biller Builder created by smillaraaq - https://repl.it/HGIt/2
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