Why an each loop in a Jenkinsfile stops at first iteration
<p>Here is the content of my <code>Jenkinsfile</code> :</p>

<pre><code>node {
    // prints only the first element 'a'
    [ 'a', 'b', 'c' ].each {
        echo it
    }
}
</code></pre>

<p>When executing the job in Jenkins (with the <a href="https://wiki.jenkins-ci.org/display/JENKINS/Pipeline+Plugin" rel="noreferrer">Pipeline plugin</a>), only the first item in the list is printed.</p>

<p>Can someone explain me this strange behavior? Is it a bug? or is it just me not understanding the Groovy syntax?</p>

<p><strong>Edit</strong> : the <code>for (i in items)</code> works as expected :</p>

<pre><code>node {
    // prints 'a', 'b' and 'c'
    for (i in [ 'a', 'b', 'c' ]) {
        echo i
    }
}
</code></pre>