title: Iterate over a list from backing bean in JavaScript
body: <p>I have a list of objects in backing bean
  and I would like to iterate over it in JavaScript,
  so I tried the following:</p>
  
  <pre><code>&lt;script&gt;
      //&lt;![CDATA[
      var length = #{fn:length(myBean.myList)};
  
      for (i = 0; i &lt;= length; i++) {
          var value = '#{myBean.myList[i].id}';
          var label = '#{myBean.myList[i].firstName}';
          alert(value);
          alert(label);
      }
      //]]&gt;
  &lt;/script&gt;
  </code></pre>
  
  <p>I get no errors in console, but it shows empty alerts. How is this caused and how can I solve it?</p>