Looping through data in Javascript, combining new id's with old
<p>Many times I'm having to loop through data and add the new to the old, but I can never seem to get it right.. Here's what I have now, basically trying to concatinate together the previous number from the new number, ultimately building a comma delimited string of numbers:</p>

<pre><code>            function showItems(){
            if(prev_numbers == undefined){
                var prev_numbers = '';
            }else{
                prev_numbers = prev_numbers;    
            }

            numbers = Math.floor(Math.random()*101);
            values = numbers +','+ prev_numbers;

                // Here is where some code would be that makes use of comma delimited numbers
                alert(values);  

            prev_numbers = values;

        }

        setInterval(showItems, 1000);
</code></pre>
