title: aws-lambda-nodejs: How can I use callback function to return a value which I printed in aws-console?
body: <p>This is the code running in an aws lambda function. </p>
  
  <pre><code>exports.handler = (event, context, callback) =&gt; {
              // TODO implement
  
            mqfunc1(func2);
  
  
  
  };
  var func2 = function(data) {
              console.log('got data: '+data);
  
  };
  var mqfunc1 = function(callback) {
          var myCallback = function(data) {
          console.log('got data: '+data);
          };
  
          var usingItNow = function(callback) {
          callback('get it?');
          };
  
  };
  </code></pre>
  
  <p>Now I do get the the message which i want to print in the console. But I want to show the same message printed in the console using the callback function inside exports.handler.</p>
  
  <p>I tried using callback function using various ways inside exports.handler but I am always getting null. I do understand that in a node js scripts all the function calls are asynchronous, so how do I return a value from any function and callback the same inside exports.handler, i.e. display the same in Execution result. </p>