Skip to content

Instantly share code, notes, and snippets.

@brauliodiez
Last active June 3, 2018 08:35
Show Gist options
  • Save brauliodiez/61bff97f198311a7b72433bb78aac61a to your computer and use it in GitHub Desktop.
Save brauliodiez/61bff97f198311a7b72433bb78aac61a to your computer and use it in GitHub Desktop.
Closure sample
const calculateFinalPrice = function () {
const discount = 0.90;
// simulate ajax call
setTimeout(function() {
const total = 200;
const final = total * discount;
console.log(final)
}, 500);
}
calculateFinalPrice();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment