snipt

Ctrl+h for KB shortcuts

JavaScript

javascript random string function

function rnd(){ return String((new Date()).getTime()).replace(/\D/gi,'') }
https://snipt.net/embed/d923f96c959900108c17f52b16e46e79/
/raw/d923f96c959900108c17f52b16e46e79/
d923f96c959900108c17f52b16e46e79
js
JavaScript
1
2019-06-11T17:08:41
True
False
False
/api/public/snipt/7565/
javascript-random-string-function
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="kd">function</span> <span class="nx">rnd</span><span class="p">(){</span> <span class="k">return</span> <span class="nb">String</span><span class="p">((</span><span class="k">new</span> <span class="nb">Date</span><span class="p">()).</span><span class="nx">getTime</span><span class="p">()).</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/\D/gi</span><span class="p">,</span><span class="s1">&#39;&#39;</span><span class="p">)</span> <span class="p">}</span> </span></pre></div> </td></tr></table>
javascript, random, string