<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Robin</title>
    <description>The latest articles on DEV Community by Robin (@robin_repeattext).</description>
    <link>https://dev.to/robin_repeattext</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4242830%2F5523b149-2b83-4c72-a4ff-8f00e20ba1dc.png</url>
      <title>DEV Community: Robin</title>
      <link>https://dev.to/robin_repeattext</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/robin_repeattext"/>
    <language>en</language>
    <item>
      <title>How I Built a Simple Text Repeater That Runs Fully in the Browser</title>
      <dc:creator>Robin</dc:creator>
      <pubDate>Fri, 13 Nov 2026 11:36:19 +0000</pubDate>
      <link>https://dev.to/robin_repeattext/how-i-built-a-simple-text-repeater-that-runs-fully-in-the-browser-5085</link>
      <guid>https://dev.to/robin_repeattext/how-i-built-a-simple-text-repeater-that-runs-fully-in-the-browser-5085</guid>
      <description>&lt;p&gt;I run a small site of text tools, and the most used one is a text repeater: type a word or emoji once, choose a count, copy the result. Here's how it works and the gotchas I hit.&lt;/p&gt;

&lt;h2&gt;
  
  
  The core
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;repeat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sep&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fill&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sep&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;Array(count).fill(text).join(sep)&lt;/code&gt; is fast enough for 100,000 copies on a phone. A naive &lt;code&gt;+=&lt;/code&gt; loop is much slower on large counts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Gotchas
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Size limits.&lt;/strong&gt; 'I love you' 10,000 times on new lines is ~110,000 characters. WhatsApp allows 65,536 per message, so I show a live size (&lt;code&gt;new Blob([out]).size&lt;/code&gt;) before the user copies.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Emoji.&lt;/strong&gt; Never reverse or slice strings with &lt;code&gt;split('')&lt;/code&gt;; use &lt;code&gt;Array.from(str)&lt;/code&gt; or &lt;code&gt;Intl.Segmenter&lt;/code&gt; so emoji and Hindi text don't break.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Clipboard on mobile.&lt;/strong&gt; &lt;code&gt;navigator.clipboard.writeText&lt;/code&gt; needs a user gesture; keep the copy inside the click handler.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Privacy.&lt;/strong&gt; Everything runs client-side, so nothing is uploaded.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;The live version is &lt;a href="https://repeattext.com/" rel="noopener noreferrer"&gt;repeat text&lt;/a&gt; on RepeatText. If you just want a quick &lt;a href="https://repeattext.com/" rel="noopener noreferrer"&gt;text repeater&lt;/a&gt; for WhatsApp or emoji, it's free with no signup. For big jobs there's a &lt;a href="https://repeattext.com/tools/repeat-text-generator/" rel="noopener noreferrer"&gt;repeat text generator&lt;/a&gt; that splits long output into parts.&lt;/p&gt;

&lt;p&gt;Feedback welcome in the comments!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
