title: Check if it is the last element in an array inside map() function
body: <p>I have an array of strings and I want to print them on different lines. </p>
  
  <p>I'm using <code>&lt;hr /&gt;</code> for this but as it is now in my code, it will put another break after the last string, fact that I want to avoid. Any ideas?</p>
  
  <p>This is my code:</p>
  
  <pre><code>return myArray.map((text, index) =&gt; (
      &lt;span key={index}&gt;
          {myArray[index]}
          {&lt;hr /&gt;}
      &lt;/span&gt;
  ));
  </code></pre>