Learnerslesson
   JAVA   
  SPRING  
  SPRINGBOOT  
 HIBERNATE 
  HADOOP  
   HIVE   
   ALGORITHMS   
   PYTHON   
   GO   
   KOTLIN   
   C#   
   RUBY   
   C++   
   HTML   
   CSS   
   JAVA SCRIPT   
   JQUERY   




repeat() - FUNCTION


The repeat() Function is Used to repeat the String a given number of times.


Let us see the below example.


Example :



<html>
<body>  
<script>

	var x = "Hello"
	var y = x.repeat(3)
	document.write(y)
    
</script>      
</body>
</html>


Output :



  HelloHelloHello

So, if you see the output. The repeat() function,


var y = x.repeat(3)

Repeats the String Hello three times.