function findMember(roomId, userName) { 
    for (var i = 0; i < rooms[roomId]['members'].length; i++) {
        if (rooms[roomId]['members'][i].userName == userName) 
            return i;    
    }
    return -1;
}
//find a member of the room X given his userName
find a member of the room X given his userName
find a member of the room X given his userName
function findMember(roomId, userName) { 
    for (var i = 0; i < rooms[roomId]['members'].length; i++) {
        if (rooms[roomId]['members'][i].userName == userName) 
            return i;    
    }
    return -1;
}
function findMember ( roomId , userName ) { for ( var i = 0 ; i < rooms [ roomId ] [ 'members' ] . length ; i ++ ) { if ( rooms [ roomId ] [ 'members' ] [ i ] . userName == userName ) return i ; } return - 1 ; }
find a member of the room X given his userName
find a member of the room X given his userName