Jquery unlimited number array event
<p>I'm not sure if this is even what you call it, but basically, I am grabbing a list of cities that is stored in one key in local storage. I am splitting them by comma, and then dynamically checking the checkboxes with the corresponding values for the id. Now I want to have any number of cities in there so I don't want to check the boxes individually like [0], [1] etc but is there there like a unlimited way to do this or something. Sorry if this isn't clear..Ill post my code below, My code below is checking the boxes from keys 0-5, I want to be  able to do 0 - unlimited , so to speak. Any help is appreciated. </p>

<pre><code>&lt;script type="text/javascript"&gt;
            var refreshId = setInterval(function()
                                        {
            var citySplit = localStorage.getItem("city2");

            var myResult = citySplit.split(",");

            $("#"+myResult[0]+"").prop("checked", true);
            $("#"+myResult[1]+"").prop("checked", true);
            $("#"+myResult[2]+"").prop("checked", true);
            $("#"+myResult[3]+"").prop("checked", true);
            $("#"+myResult[4]+"").prop("checked", true);
            $("#"+myResult[5]+"").prop("checked", true);
             }, 6500);

            &lt;/script&gt;
</code></pre>
