Return to Snippet

Revision: 32435
at September 24, 2010 20:50 by tennison


Initial Code
function test(f){
  var x = 'private var';
  if (typeof f == "function") f(x); else alert('no callback');
}


test(function(x){
   alert(x)
})


//////////
function test2(){
  var x = 'private var';
  return x
}

var result = test2(); // = x

Initial URL

                                

Initial Description

                                

Initial Title
JS callback function

Initial Tags

                                

Initial Language
JavaScript