Just like any other variable, we can move callback inside a function that contains all the references to its name.
callback
function request() { function callback(x) { log('received "' + x + '"'); } $.get('request', callback); } request();