title: Groovy closures - Missing property
body: <p>Trying to learn groovy closures, before writing jenkins pipeline as script.</p>
  
  <p>Below code:</p>
  
  <pre><code>def scores = [72,29,32,44,56]
  
  def analyse(closure){
      closure(scores)
  }
  
  def firstScore(array){
      return array[0]
  }
  
  analyse(firstScore)
  </code></pre>
  
  <hr>
  
  <p>gives error:</p>
  
  <pre><code>groovy.lang.MissingPropertyException: No such property: firstScore for class: groovy.lang.Binding
      at groovy.lang.Binding.getVariable(Binding.java:63)
  </code></pre>
  
  <hr>
  
  <p>How to resolve this error?</p>