Output objects with for loop - Javascript Statement

Javascript examples for Statement:for

Description

Output objects with for loop

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <title>Date Parse</title> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=function(){//from   w  w  w  . j av a 2s.  c om
var dateText = ["19", "May", "1945", "?", "22", "August", "1945"];
var d = '';
for(var i = 0; i < dateText.length; i++) {
   d += dateText[i] + ' ';
}
console.log(d);
    }

      </script> 
   </head> 
   <body>  
   </body>
</html>

Related Tutorials