react render for loop

JavaScript
// for loop workaround in react render
[...Array(n)].map((_, index) => <span key={index}>element {index}</span>)render: function() {
  const elements = ['one', 'two', 'three'];
  return (
    <ul>
      {elements.map((value, index) => {
        return <li key={index}>{value}</li>
      })}
    </ul>
  )
}

Source

Also in JavaScript: