hamt.js
function pack(edit, count, removed, elements) {
    var children = new Array(count - 1);
    var g = 0;
    var bitmap = 0;
    for (var i = 0, len = elements.length; i < len; ++i) {
        if (i !== removed) {
            var elem = elements[i];
            if (elem && !isEmptyNode(elem)) {
                children[g++] = elem;
                bitmap |= 1 << i;
            }
        }
    }
    return IndexedNode(edit, bitmap, children);
}
function pack(edit, count, removed, elements) {
    var children = new Array(count - 1);
    var g = 0;
    var bitmap = 0;
    for (var i = 0, len = elements.length; i < len; ++i) {
        if (i !== removed) {
            var elem = elements[i];
            if (elem && !isEmptyNode(elem)) {
                children[g++] = elem;
                bitmap |= 1 << i;
            }
        }
    }
    return IndexedNode(edit, bitmap, children);
}
function pack ( edit , count , removed , elements ) { var children = new Array ( count - 1 ) ; var g = 0 ; var bitmap = 0 ; for ( var i = 0 , len = elements . length ; i < len ; ++ i ) { if ( i !== removed ) { var elem = elements [ i ] ; if ( elem && ! isEmptyNode ( elem ) ) { children [ g ++ ] = elem ; bitmap |= 1 << i ; } } } return IndexedNode ( edit , bitmap , children ) ; }
Collapse an array node into a indexed node.

@param edit Current edit.
@param count Number of elements in new array.
@param removed Index of removed element.
@param elements Array node children before remove.
Collapse an array node into a indexed node .