title: What variables will be sent to an anonymous function?
body: <p>I'm working with a javascript mini-library called Reqwest. It's suppose to do ajax-requests, but in internet explorer it throws the error. <code>Peer dependency xhr2 required! Please npm install xhr2'</code>. Xhr2 is a library is suppose to be used with node.js I run the code in the frontend. </p>
  
  <p>I'm trying to understand what this code does, how it get's executed and where the variables come from. My best bet right now is that for some reason <code>context.hasOwnProperty('window')</code> is false and that assumes that the code is running server side. But I have no idea why.</p>
  
  <pre><code>!function (name, context, definition) {
    if (typeof module != 'undefined' &amp;&amp; module.exports) module.exports = definition()
    else if (typeof define == 'function' &amp;&amp; define.amd) define(definition)
    else context[name] = definition()
  }('reqwest', this, function () {
  
    var context = this
  
    if (context.hasOwnProperty('window')) {
      var doc = document
        , byTag = 'getElementsByTagName'
        , head = doc[byTag]('head')[0]
    } else {
      var XHR2
      try {
        XHR2 = require('xhr2')
      } catch (ex) {
        throw new Error('Peer dependency `xhr2` required! Please npm install xhr2')
      }
    }
  ...
  }
  </code></pre>