src/lib/collections/linked-list.js
function (node, value) {
        assertType(node, LinkedListNode);

        var newNode;

        if (value instanceof LinkedListNode) {
            newNode = value;
            this.insertNodeBefore(node, newNode);
            if (node === this.head) {
                this.head = newNode;
            }
        }
        else {
            newNode = new LinkedListNode(value);
            this.addBefore(node, newNode);
        }

        return newNode;
    }
function (node, value) {
        assertType(node, LinkedListNode);

        var newNode;

        if (value instanceof LinkedListNode) {
            newNode = value;
            this.insertNodeBefore(node, newNode);
            if (node === this.head) {
                this.head = newNode;
            }
        }
        else {
            newNode = new LinkedListNode(value);
            this.addBefore(node, newNode);
        }

        return newNode;
    }
function ( node , value ) { assertType ( node , LinkedListNode ) ; var newNode ; if ( value instanceof LinkedListNode ) { newNode = value ; this . insertNodeBefore ( node , newNode ) ; if ( node === this . head ) { this . head = newNode ; } } else { newNode = new LinkedListNode ( value ) ; this . addBefore ( node , newNode ) ; } return newNode ; }
Adds the specified new node before the specified existing node in the LinkedList.
@param {LinkedListNode} node The LinkedListNode before which to insert newNode.
@param {LinkedListNode|Object} value The value or the LinkedListNode to add to the LinkedList.
@returns {LinkedListNode}
Adds the specified new node before the specified existing node in the LinkedList .