javascript/selenium-core/scripts/htmlutils.js
function are_equal(a1, a2)
{
    if (typeof(a1) != typeof(a2))
        return false;

    switch(typeof(a1)) {
        case 'object':
            // arrays
            if (a1.length) {
                if (a1.length != a2.length)
                    return false;
                for (var i = 0; i < a1.length; ++i) {
                    if (!are_equal(a1[i], a2[i]))
                        return false
                }
            }
            // associative arrays
            else {
                var keys = {};
                for (var key in a1) {
                    keys[key] = true;
                }
                for (var key in a2) {
                    keys[key] = true;
                }
                for (var key in keys) {
                    if (!are_equal(a1[key], a2[key]))
                        return false;
                }
            }
            return true;

        default:
            return a1 == a2;
    }
}
function are_equal(a1, a2)
{
    if (typeof(a1) != typeof(a2))
        return false;

    switch(typeof(a1)) {
        case 'object':
            // arrays
            if (a1.length) {
                if (a1.length != a2.length)
                    return false;
                for (var i = 0; i < a1.length; ++i) {
                    if (!are_equal(a1[i], a2[i]))
                        return false
                }
            }
            // associative arrays
            else {
                var keys = {};
                for (var key in a1) {
                    keys[key] = true;
                }
                for (var key in a2) {
                    keys[key] = true;
                }
                for (var key in keys) {
                    if (!are_equal(a1[key], a2[key]))
                        return false;
                }
            }
            return true;

        default:
            return a1 == a2;
    }
}
function are_equal ( a1 , a2 ) { if ( typeof ( a1 ) != typeof ( a2 ) ) return false ; switch ( typeof ( a1 ) ) { case 'object' : // arrays if ( a1 . length ) { if ( a1 . length != a2 . length ) return false ; for ( var i = 0 ; i < a1 . length ; ++ i ) { if ( ! are_equal ( a1 [ i ] , a2 [ i ] ) ) return false } } // associative arrays else { var keys = { } ; for ( var key in a1 ) { keys [ key ] = true ; } for ( var key in a2 ) { keys [ key ] = true ; } for ( var key in keys ) { if ( ! are_equal ( a1 [ key ] , a2 [ key ] ) ) return false ; } } return true ; default : return a1 == a2 ; } }
Returns true if two arrays are identical, and false otherwise.

@param a1  the first array, may only contain simple values (strings or
numbers)
@param a2  the second array, same restricts on data as for a1
@return    true if the arrays are equivalent, false otherwise.
Returns true if two arrays are identical and false otherwise .