title: Why does the jenkinsfile use a closure in this way?
body: <p>It's a common pattern to write Jenkins pipeline code like this:</p>
  
  <pre><code>def call(body) {    
      def config = [:]
      body.resolveStrategy = Closure.DELEGATE_FIRST
      body.delegate = config
      body()
  }
  </code></pre>
  
  <p>I'm not sure how to word this simply, but this closure get implicitly imported and can be called by the file name of the <code>.groovy</code> file it lives in. </p>
  
  <p>I call it like:</p>
  
  <pre><code>MyClosure { myarg = 'sdfsdf' }
  </code></pre>
  
  <p>I not entirely sure what this is doing. It's doing <code>call(body)</code> and then assigning <code>body</code> as the delegate. so that means the closure I pass it is the delegate, but isn't that just the owner? Wah? me confused.</p>