src/dual-listbox.js
/**
     * Returns an array where the first element is the old index of the currently
     * selected item in the right box and the second element is the new index.
     *
     * @private
     * @param {string} direction
     * @return {int[]}
     */
Returns an array where the first element is the old index of the currently
selected item in the right box and the second element is the new index.

@private
@param {string} direction
@return {int[]}
Returns an array where the first element is the old index of the currently selected item in the right box and the second element is the new index . @private @param { string } direction @return { int [] }
_findSelected(direction) {
        const oldIndex = this.selected.findIndex((element) =>
            element.classList.contains("dual-listbox__item--selected")
        );
        let newIndex = oldIndex;
        if (DIRECTION_UP === direction && oldIndex > 0) {
            newIndex -= 1;
        } else if (
            DIRECTION_DOWN === direction &&
            oldIndex < this.selected.length - 1
        ) {
            newIndex += 1;
        }
        return [oldIndex, newIndex];
    }
_findSelected ( direction ) { const oldIndex = this . selected . findIndex ( ( element ) => element . classList . contains ( "dual-listbox__item--selected" ) ) ; let newIndex = oldIndex ; if ( DIRECTION_UP === direction && oldIndex > 0 ) { newIndex -= 1 ; } else if ( DIRECTION_DOWN === direction && oldIndex < this . selected . length - 1 ) { newIndex += 1 ; } return [ oldIndex , newIndex ] ; }
Returns an array where the first element is the old index of the currently
 selected item in the right box and the second element is the new index.
Returns an array where the first element is the old index of the currently selected item in the right box and the second element is the new index .