title: Find caller script in JavaScript?
body: <p>Consider these script fragments.</p>
  
  <pre><code>&lt;script data-name="script1"&gt;
      foo();
  &lt;/script&gt;
  
  &lt;script data-name="script2"&gt;
      foo();
  &lt;/script&gt;
  
  &lt;script&gt;
      function foo(){
  //      console.log(arguments.?);
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>Is there a way to find out which script function foo was called from the line denoted by the "//"?</p>