function iterationUpdate(visuals, i, option, j) {
    init(option.val);
    if (visuals[option.val])
        if (i < visuals[option.val].length && i >= 0) {
            if (j) {
                visuals[option.val][j].color = 'blue';
            }
            visuals[option.val][i].color = 'red';
        }
    animate();
    return new Promise(resolve => setTimeout(resolve, time));
}
// ex: in bubble sort, the inner for loop should run this for the best looking visuals
in bubble sort, the inner for loop should run this for the best looking visuals
in bubble sort the inner for loop should run this for the best looking visuals
function iterationUpdate(visuals, i, option, j) {
    init(option.val);
    if (visuals[option.val])
        if (i < visuals[option.val].length && i >= 0) {
            if (j) {
                visuals[option.val][j].color = 'blue';
            }
            visuals[option.val][i].color = 'red';
        }
    animate();
    return new Promise(resolve => setTimeout(resolve, time));
}
function iterationUpdate ( visuals , i , option , j ) { init ( option . val ) ; if ( visuals [ option . val ] ) if ( i < visuals [ option . val ] . length && i >= 0 ) { if ( j ) { visuals [ option . val ] [ j ] . color = 'blue' ; } visuals [ option . val ] [ i ] . color = 'red' ; } animate ( ) ; return new Promise ( resolve => setTimeout ( resolve , time ) ) ; }
ex: in bubble sort, the inner for loop should run this for the best looking visuals
ex : in bubble sort the inner for loop should run this for the best looking visuals