title: PHP foreach loop in Javascript
body: <p>How can i make a loop like this one in Javascript?</p>
  
  <pre><code>foreach ($viewData['cure'] as $cure) 
  </code></pre>
  
  <p>In this loop I would like to print the result in JS</p>
  
  <pre><code>$("#new").append('&lt;label for="nice_text"&gt;ID Type&lt;/label&gt;&lt;input type="text" id="nice_text" name="cureIdtype" class="input-text" VALUE="&lt;?php echo (string)$cure["id_type"] ?&gt;"/&gt;');
  </code></pre>