function prepend(elem, prev) {
    removeElement(prev);
    const { parent } = elem;
    if (parent) {
        const childs = parent.children;
        childs.splice(childs.indexOf(elem), 0, prev);
    }
    if (elem.prev) {
        elem.prev.next = prev;
    }
    prev.parent = parent;
    prev.prev = elem.prev;
    prev.next = elem;
    elem.prev = prev;
}
/**
 * Prepend an element before another.
 *
 * @category Manipulation
 * @param elem The element to prepend before.
 * @param prev The element be added.
 */
Prepend an element before another.
@category Manipulation
@param elem The element to prepend before.
@param prev The element be added.
Prepend an element before another . @category Manipulation @param elem The element to prepend before . @param prev The element be added .
function prepend(elem, prev) {
    removeElement(prev);
    const { parent } = elem;
    if (parent) {
        const childs = parent.children;
        childs.splice(childs.indexOf(elem), 0, prev);
    }
    if (elem.prev) {
        elem.prev.next = prev;
    }
    prev.parent = parent;
    prev.prev = elem.prev;
    prev.next = elem;
    elem.prev = prev;
}
function prepend ( elem , prev ) { removeElement ( prev ) ; const { parent } = elem ; if ( parent ) { const childs = parent . children ; childs . splice ( childs . indexOf ( elem ) , 0 , prev ) ; } if ( elem . prev ) { elem . prev . next = prev ; } prev . parent = parent ; prev . prev = elem . prev ; prev . next = elem ; elem . prev = prev ; }
Prepend an element before another.
Prepend an element before another .