js/twitter.js
// if one of the siblings is missing (null/undefined), returns without throwing an error
if one of the siblings is missing (null/undefined), returns without throwing an error
if one of the siblings is missing ( null / undefined ) returns without throwing an error
function safeHideSiblings(element, number_of_siblings) {
    if (!element || number_of_siblings === 0) {
        return;
    }
    if (number_of_siblings < 0) {
        let sibling = element.previousSibling;
        if (sibling) {
            sibling.style.setProperty('display', 'none');
            safeHideSiblings(sibling, number_of_siblings+1)
        }
    } else {
        let sibling = element.nextSibling;
        if (sibling) {
            sibling.style.setProperty('display', 'none');
            safeHideSiblings(sibling, number_of_siblings-1)
        }
    }
}
function safeHideSiblings ( element , number_of_siblings ) { if ( ! element || number_of_siblings === 0 ) { return ; } if ( number_of_siblings < 0 ) { let sibling = element . previousSibling ; if ( sibling ) { sibling . style . setProperty ( 'display' , 'none' ) ; safeHideSiblings ( sibling , number_of_siblings + 1 ) } } else { let sibling = element . nextSibling ; if ( sibling ) { sibling . style . setProperty ( 'display' , 'none' ) ; safeHideSiblings ( sibling , number_of_siblings - 1 ) } } }
if one of the siblings is missing (null/undefined), returns without throwing an error
if one of the siblings is missing ( null / undefined ) returns without throwing an error