Repeat word for as many times as it has characters - Javascript String Operation

Javascript examples for String Operation:String Character

Description

Repeat word for as many times as it has characters

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <title>Repeat Word</title> 
      <script type="text/javascript">

var word = "";
word = "this is a test"
for(var i=0;i<word.length;i++)
{
   document.write(word+"<br />");
}

      </script> 
   </head> 
   <body>   
   </body>/*w ww  .j av a  2s.c  o  m*/
</html>

Related Tutorials