How to modify such data in JS arrays
<p>Got issue
My javascript array contains dates
for ex. <code>19.4.2003,28.11.1997,3.1,,29.6,7.11.2008</code> (date-month-year).
As you can see some of dates are missing ( just <code>,,</code> ) and some are without a year (for ex. <code>29.6</code>).<br>
The array above should looks like: <code>19.4,28.11,3.1,,29.6,7.11</code>
Then I need to find an element and get its index with <code>jQuery.inArray("searchVar", myArr);</code>
The code is below</p>

<pre><code>if (data.response) { //response from social network
    var f_cnt = data.response.length;
    for(var i=0;i&lt;f_cnt;i++) { 
        holidaysArr.push(data.response[i].bdate); //pushing date in array
        //modify in loop? or call function to modify later?
    }
    holidaysLoaded=true; // just flag
}       
</code></pre>

<p>Pushing (ok) -> modifying -> searching for element.
Need your help.</p>

<p><em>UPDATE</em><br>
While making project understand I need to call social network API more than once so saved data in my array. Check it:</p>

<pre><code>    if (data.response) {
    friends_data = data.response.sort(sFirstName); //sorting nvm
    f_cnt = data.response.length; //count of arrayfields
    holidaysLoaded=true;    //flag
}
</code></pre>

<p>So array has <code>uid</code>, <code>first_name</code>, <code>last_name</code>, <code>bdate</code> atm. Not just <code>bdate</code> as hour ago.
Question is: How to modify all <code>friends_data[i].bdate</code> with <code>match</code>? Empty birthdays have <code>undefined</code> atm. I think I need something like</p>

<pre><code>for(var i=0;i&lt;f_cnt;i++){
   friends_data[i].bdate = cutFunc(friends_data[i].bdate);
}
</code></pre>

<p>and form <code>cutFunc(param)</code> with checking on <code>undefined</code>, if not it will match with your function? </p>

<p><em>UPDATE 2</em> cutFunc should be smth like this:</p>

<pre><code>function cutFunc(param) {
if(param==undefined) return
else return param.match(/\d+\.\d+/g);
}
</code></pre>

<p>thank you :)</p>
