function getOverlayIndex( overlays, element ) {
    var i;
    for ( i = overlays.length - 1; i >= 0; i-- ) {
        if ( overlays[ i ].element === element ) {
            return i;
        }
    }

    return -1;
}
Determines the index of a specific overlay element within an array of overlays.

@private
@inner
@param {Array<Object>} overlays - The array of overlay objects, each containing an `element` property.
@param {Element} element - The DOM element of the overlay to find.
@returns {number} The index of the matching overlay in the array, or -1 if not found.