Repeat() using strings in JS

Repeat() using strings in JS




<!DOCTYPE html>
<html>
<head>
<title>Test page</title>
<script type="text/javascript">

/*repeat function is basically used to  repeat the string */

var str= "THIS IS AN ARTISITIC STYLE OF REPRESENTING THINGS";
var newie = str.repeat("5");
// means it will get repeated as many number of times as defined in parameters
console.log(newie);



</script>

</head>
<body>
<h1></h1>
</body>
</html>



Comments

Popular posts from this blog