Online HTML Editor
Javascript Online Compiler
index.html
Change Theme
Compress code
Uncompress code
Download Code
Clear Code
Copy Code!
RunĀ
Click to run or ctrl+s
Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Article - JavaScript repeat string method 3</title> </head> <body> <h2>The <code>repeat()</code> returns a new string by creating a copy of existing one.</h2> <p>Press <kbd>F12</kbd> to open the console and see the output of the program.</p> <script> const str = "tick tock, "; console.log(str.repeat(Infinity)); // RangeError </script> </body> </html>
RunĀ