title: Print set element in javascript
body: <p>I am trying to print the set element through innerHTML, but I am not getting the desired result. While I tried with <code>document.write()</code>,it is printing but I want to use only innerHTML.</p>
  
  <p>Here is my source code:</p>
  
  <pre><code>  &lt;div id="demo"&gt; &lt;/div&gt;  
    &lt;script type="text/javascript"&gt;
       var i, item;
       var setObj1 = new Set();
       for(i=0;i&lt;5;i++)
       setObj1.add(i);
  
       for (item of setObj1.values())
       //document.write(item+",");
       document.getElementById('demo').innerHTML="The set value is: "+ item;         
    &lt;/script&gt;
  </code></pre>
  
  <blockquote>
    <p>Output: 4 </p>
    
    <p>Desire output: 0 1 2 3 4</p>
  </blockquote>
  
  <p>Please suggest me how to use innerHTML to print the output.I have tried console log and document.write(), they are working.</p>