title: Is there a production safe version of Function.caller in Javascript?
body: <p>Is there a way to return the function that invoked the current function? <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/caller" rel="noreferrer">Function.caller</a> will only work for non-strict mode applications.</p>
  
  <p>I want to be able to use this functionality for production environment, therefore I need strict mode to be turned on.</p>
  
  <p>Expected return: function itself or the name of function. </p>
  
  <pre><code>function a() {
   b()
  }
  
  function b() {
   console.log(b.caller)
  }
  </code></pre>
  
  <p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/caller" rel="noreferrer">Function.caller</a> will throw an error when used in strict mode:</p>
  
  <p>Uncaught TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them</p>