title: Iterate through array in Reactjs
body: <pre><code>const cal_days =['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
  const cal_months =['Jan', 'Feb', 'March', 'April',
   'May', 'June', 'July', 'August', 'Sept', 'Oct', 'Nov', 'Dec'];
  const daysinmonth =[31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
  const curr =new Date();
  var d = new Date();
  var n = d.getMonth();
  var yearName=d.getFullYear();
  var monName= cal_months[n];
  var firstDay = new Date(yearName,n, 1);
  var startD = firstDay.getDay();
  var num= daysinmonth[n];
  var day=1;
  
  class Show extends Component{
   numrow(){ 
    var array=[];
    for (var i = 1; i &lt;=num; i++) {
    for (var j = 0; j &lt;= 6; j++) { 
      if (day &lt;= num &amp;&amp; (i &gt; 0 || j &gt;= startD)) {
        array.push(i);
        day++;
        }
        if (day &gt; n)
          break;
         }
        }
   array.map(function(){
   for (var i = 1; i &lt;=6; i++) { 
    // console.log(&lt;td&gt;{array[i]}&lt;/td&gt;);
    return &lt;td&gt;{array[i]}&lt;/td&gt;;
   }
   })
   }
   render(){
   var daysname= cal_days.map(function(day){
   for(var i = 0; i &lt;= 6; i++ ){
    return &lt;td&gt;{day}&lt;/td&gt;;}
   })
   return (
   &lt;div&gt;
   &lt;table&gt;
   &lt;tbody&gt;
   &lt;tr&gt;
   {daysname}
   &lt;/tr&gt;
   &lt;tr&gt;
   {this.numrow()}
   &lt;/tr&gt;
   &lt;/tbody&gt;
   &lt;/table&gt;
   &lt;/div&gt;
   ) 
    }
    };
  </code></pre>
  
  <hr>
  
  <p>I have started studying Reactjs. I am making this calendar in Reactjs. I want to display the days 1,2,3..so on. Why does the function numrow doesn't display anything? I haven't posted the whole code here, just a part of it. Have I used array.map() function correctly?</p>