Similar javascript code for this?
<p>I'm not very good at javascript and I wanted to know if doing this is possible in javascript?</p>

<pre><code>&lt;?php

        $str = file_get_contents('splashes.txt');

        $splashes = explode("\n",$str);

        $ind = rand(1, count($splashes)) -1;


        echo $splashes[$ind];

?&gt;
</code></pre>

<p>What would the equivalent of that be in javascript?</p>
