amitabhaghosh197
1/23/2016 - 6:27 AM

call another function from annonymous function

call another function from annonymous function

(function( $, window, document ){
  var foo = 'Hello';
  var bar = 'World!'
  
  function baz(){
      return foo + ' ' + bar;
  }

  window.baz = baz; //Assign 'baz' to the global variable 'baz'...
})(jQuery, window, document);

function r(){
console.log(baz());
};

r();