Skip to content

Instantly share code, notes, and snippets.

@mpj
Last active January 14, 2019 16:03
Show Gist options
  • Save mpj/b56371c672122a098d52 to your computer and use it in GitHub Desktop.
Save mpj/b56371c672122a098d52 to your computer and use it in GitHub Desktop.
Examples for video "Closures - Part 5 of Functional Programming in JavaScript" (http://youtu.be/CQqwU2Ixu-U)
var me = 'Bruce Wayne'
function greetMe() {
console.log('Hello, ' + me + '!')
}
greetMe() // Hello, Bruce Wayne!
function sendRequest() {
var requestID = '123'
$.ajax({
url: '/myUrl',
success: function(response) {
alert('Request ' + requestID + ' returned')
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment