For example if i'm keeping array of references via id like that:
if(typeof channel_boards[misc.channel_id] == 'undefined') {
channel_boards[misc.channel_id] = $('<div class="channel" channel_id="'+misc.channel_id+'"></div>').appendTo('#board');
}
And then i'm looping through array to find required reference. I'm looping through undefined properties as well. Is it possible to loop only through defined properties?
for(i=0;i<channel_boards.length;i++)
{
if(channel_boards[i] != undefined)
{
if(channel_boards[i].attr('channel_id') != visible) {channel_boards[i].addClass('hidden_board');}
else {channel_boards[i].removeClass('hidden_board');}
}
}
Maybe i should change the way i'm storing references? Via object for example, but how i'll be able to find proper reference via id number.